Defines all the authorization status
Namespace: Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2016.0.105.16 (2016.0.105.16)
Syntax
C# |
---|
[FlagsAttribute] public enum VGAuthorizationStatus |
Visual Basic |
---|
<FlagsAttribute> Public Enumeration VGAuthorizationStatus |
Members
Member name | Value | Description | |
---|---|---|---|
Failure | 1 | The authorization fails. | |
UserNotFound | 2 | The authorization fails. The user is not found in the repository | |
UserNotAuthorized | 4 | The authorization fails. The user does not have any granted role for the application. | |
ProcessCanceled | 8 | The authorization fails. The authorization process has been canceled by the user. | |
Success | 16 | The authorization succeeds. | |
VersionNotCompatible | 32 | The version of the permissions is not compatible with the application. |
Remarks
Since Status can be a combination (bit-flag) of enum values, you can't use
the equality operator to compare them. To test if an authorization has failed, you must use this syntax:
C# | Copy |
---|---|
if ((status & VGAuthorizationStatus.Failure) == VGAuthorizationStatus.Failure) { // Authentication has failed if ((status & VGAuthorizationStatus.UserNotFound) == VGAuthorizationStatus.UserNotFound) { // The user is not found in the repository ... } } |
Visual Basic | Copy |
---|---|
if (status And VGAuthorizationStatus.Failure) = VGAuthorizationStatus.Failure Then ' Authentication has failed if (status And VGAuthorizationStatus.UserNotFound) = VGAuthorizationStatus.UserNotFound Then ' The user is not found in the repository ... End If End If |