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