Checks whether the specified permission is granted to the principal.
Namespace: Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2017.0.101.17 (2017.0.101.17)
Syntax
C# |
---|
bool HasPermission(
string fullname
) |
Visual Basic |
---|
Function HasPermission (
fullname As String
) As Boolean |
Parameters
- fullname
- Type: System..::..String
The full name of the permission, including the folder path.
Return Value
Type:
Booleantrue if the principal has the permission, false otherwise
Remarks
Examples
The following example checks whether the permission "My permission" stored in the root of permissions is granted to the current user.
Visual Basic | Copy |
---|
If not VGSecurityManager.Principal.HasPermission("My permission") Then
End If |
C# | Copy |
---|
if (!VGSecurityManager.Principal.HasPermission("My permission"))
{
} |
The following example checks whether the permission "Disable Edition" contained in the folder "Customer" is granted to the current user.
C# | Copy |
---|
VGSecurityManager.Principal.HasPermission("\Customers\Disable Edition") |
See Also