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( Guid id ) |
| Visual Basic (Declaration) |
|---|
Function HasPermission ( _ id As Guid _ ) As Boolean |
Parameters
- id
- Type: System..::.Guid
The Visual Guard unique identifier of the permission
Return Value
true if the principal has the permission, false otherwise
Examples
The following example checks whether the permission "{AEE3A747-05FB-4f90-BD3A-EF872E4D3211}" is granted to the current user.
CopyVB.NET
CopyC#
If not VGSecurityManager.Principal.HasPermission(new Guid ("AEE3A747-05FB-4f90-BD3A-EF872E4D3211")) Then ' the permission is not granted ... End If
if (!VGSecurityManager.Principal.HasPermission(new Guid ("AEE3A747-05FB-4f90-BD3A-EF872E4D3211"))) { // the permission is not granted ... }