PermissionSet.GetPermission Method (Type)

 

Gets a permission object of the specified type, if it exists in the set.

Namespace:   System.Security
Assembly:  mscorlib (in mscorlib.dll)

public IPermission GetPermission(
	Type permClass
)

Parameters

permClass
Type: System.Type

The type of the desired permission object.

Return Value

Type: System.Security.IPermission

A copy of the permission object of the type specified by the permClass parameter contained in the PermissionSet, or null if none exists.

The method returns null for an UnrestrictedPermissionSet. Although an UnrestrictedPermissionSet effectively contains all permissions, it does not have any actual instances to return.

Notes to Inheritors:

When you inherit from PermissionSet, you can change the behavior of the GetPermission method by overriding the GetPermissionImpl method.

.NET Framework
Available since 1.1
Return to top
Show: