This documentation is archived and is not being maintained.

PermissionSet.GetPermission Method

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
)
public IPermission GetPermission (
	Type permClass
)
public function GetPermission (
	permClass : Type
) : IPermission
Not applicable.

Parameters

permClass

The Type of the desired permission object.

Return Value

A copy of the permission object of the type specified by the permClass parameter contained in the PermissionSet, or a null reference (Nothing in Visual Basic) if none exists.

The method returns a null reference (Nothing in Visual Basic) for an UnrestrictedPermissionSet. Although an UnrestrictedPermissionSet effectively contains all permissions, it does not have any actual instances to return.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Show: