Microsoft SDK for Java

checkClass

The checkClass method of the PolicyEngine Class contains the following signatures:

checkClass(Class cls,PermissionID pid)
checkClass(Class cls,String pname)
checkClass(Class cls,PermissionID pid,Object sreq)
checkClass(Class cls,ISecurityRequest sreq)

checkClass(Class cls,PermissionID pid)

Performs a security check directly against a specified class. If the class does not possess the specified type of permission, a SecurityException is thrown.

Syntax

public static void checkClass(Class cls,PermissionID pid);

Parameters

cls The class to check against.
pid The type of permission to check for.

Exceptions

SecurityException if the security check fails.

checkClass(Class cls,String pname)

Performs a security check directly against a specified class. If the class does not possess the specified type of permission, a SecurityException is thrown. The permission type is specified as a permission name (instead of a PermissionID object).

Syntax

public static void checkClass(Class cls,String pname);

Parameters

cls The class to check against.
pname The name of the permission to check for.

Exceptions

SecurityException if the security check fails.

checkClass(Class cls,PermissionID pid,Object sreq)

Performs a security check directly against a specified class. The class must possess the specified type of permission, and the parameterized check against the class's associated permission object must pass, or a SecurityException is thrown.

Syntax

public static void checkClass(Class cls,PermissionID pid,Object sreq);

Parameters

cls The class to check against.
pid The type of permission to check for.
sreq The security request object.

Exceptions

SecurityException if the security check fails.

checkClass(Class cls,ISecurityRequest sreq)

Performs a security check directly against a specified class. The class must possess the specified type of permission, and the parameterized check against the class's associated permission object must pass, or a SecurityException is thrown.

Syntax

public static void checkClass(Class cls,ISecurityRequest sreq);

Parameters

cls The class to check against.
sreq The object that determines the type of permission to check for and also represents the security request object.

Remarks

This method is a variation on the checkClass(Class,PermissionID,Object) method, where the ISecurityRequest object is used to determine the permission type, and is also used as the permission request object.

Exceptions

SecurityException if the security check fails.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.