Checks whether the specified permission is granted to the principal.
Namespace:
Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 3.2.912.1 (3.2.912.01)
Syntax
C# |
---|
bool HasPermission( string fullname ) |
Visual Basic (Declaration) |
---|
Function HasPermission ( _ fullname As String _ ) As Boolean |
Parameters
- fullname
- Type: System..::.String
The full name of the permission, including the folder path.
Return Value
true if the principal has the permission, false otherwiseRemarks
this method is not case sensitive
Examples
The following example checks whether the permission "My permission" stored in the root of permissions is granted to the current user.
The following example checks whether the permission "Disable Edition" contained in the folder "Customer" is granted to the current user.
CopyVB.NET
If not VGSecurityManager.Principal.HasPermission("My permission") Then ' the permission is not granted ... End If
CopyC#
if (!VGSecurityManager.Principal.HasPermission("My permission")) { // the permission is not granted ... }
CopyC#
VGSecurityManager.Principal.HasPermission("\Customers\Disable Edition")