Checks whether the specified permission is granted to the principal.
Namespace: Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2016.0.105.16 (2016.0.105.16)
Syntax
C# |
---|
bool HasPermission(
Guid id
) |
Visual Basic |
---|
Function HasPermission (
id As Guid
) As Boolean |
Parameters
- id
- Type: System..::..Guid
The Visual Guard unique identifier of the permission
Return Value
Type:
Booleantrue 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.
Visual Basic | Copy |
---|
If not VGSecurityManager.Principal.HasPermission(new Guid ("AEE3A747-05FB-4f90-BD3A-EF872E4D3211")) Then
End If |
C# | Copy |
---|
if (!VGSecurityManager.Principal.HasPermission(new Guid ("AEE3A747-05FB-4f90-BD3A-EF872E4D3211")))
{
} |
See Also