Gets the specified VGIPermission object.
Namespace:
Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 3.2.912.1 (3.2.912.01)
Syntax
| C# |
|---|
VGIPermission GetPermission( string fullname ) |
| Visual Basic (Declaration) |
|---|
Function GetPermission ( _ fullname As String _ ) As VGIPermission |
Parameters
- fullname
- Type: System..::.String
The full name of the permission, including the folder path.
Return Value
The specified VGIPermission object if the permission is granted to the principal. Returns null (Nothing in VB) if the permission is not granted or it does not exist.
Remarks
this method is not case sensitive
Examples
The following example gets the permission "My permission" stored in the root of permissions.
CopyVB.NET
CopyC#
The following example gets the permission "Disable Edition" contained in the folder "Customer".
CopyC#
Dim myPerm as VGIPermission = VGSecurityManager.Principal.GetPermission("My permission") If myPerm is Nothing Then ' the permission is not granted ... Else Dim myValue as String = CType(myPerm(myValue), String) End If
VGIPermission myPerm = VGSecurityManager.Principal.GetPermission("My permission") if (myPerm == null) { // the permission is not granted ... } Else { string myValue (string)myPerm[myValue]; }
VGSecurityManager.Principal.GetPermission("\Customers\Disable Edition")