Visual Guard Class Library Documentation

VGIPrincipal.HasPermission Method (Guid)

Checks whether the specified permission is granted to the principal.

bool HasPermission(
   Guid id
);

Parameters

id
The Visual Guard unique identifier of the permission

Return Value

true if the principal has the permission, false otherwise

Example

The following example checks whether the permission "{AEE3A747-05FB-4f90-BD3A-EF872E4D3211}" is granted to the current user.

[Visual Basic]
If not VGSecurityManager.Principal.HasPermission(new Guid ("AEE3A747-05FB-4f90-BD3A-EF872E4D3211")) Then
    ' the permission is not granted ...
End If
[C#]
if (!VGSecurityManager.Principal.HasPermission(new Guid ("AEE3A747-05FB-4f90-BD3A-EF872E4D3211")))
{
    // the permission is not granted ...
}

See Also

VGIPrincipal Interface | Novalys.VisualGuard.Security Namespace | VGIPrincipal.HasPermission Overload List