PermissionSet::GetPermission Method (Type^)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

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

IPermission^ GetPermission(
	Type^ 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