Checks whether the specified permission is granted to the principal.

Namespace: Novalys.VisualGuard.Security
Assembly: 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: Boolean
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.
Visual Basic Copy imageCopy
If not VGSecurityManager.Principal.HasPermission(new Guid ("AEE3A747-05FB-4f90-BD3A-EF872E4D3211")) Then
    ' the permission is not granted ...
End If
C# Copy imageCopy
if (!VGSecurityManager.Principal.HasPermission(new Guid ("AEE3A747-05FB-4f90-BD3A-EF872E4D3211")))
{
    // the permission is not granted ...
}

See Also