CheckSecurityLevel
The function CheckSecurityLevel checks whether the current user has access to the specified security level.
Function | Group | Execution | Windows | Embedded | Thin Client | Mobile Access |
---|---|---|---|---|---|---|
CheckSecurityLevel | Security | Synchronous | Supported | Supported | Supported | Supported |
Syntax
CheckSecurityLevel(numLevel,optNumType)
- numLevel
- The security level to be checked.
- optNumType
- The type of security level to check: 0 is Runtime, 1 is Development.
This is an optional parameter; if no value is specified, the default value is 0.
Returned value
Value | Description |
---|---|
0 | The current user does not have access to the specified security level. |
1 | The current user has access to the specified security level. |
Notes
Each user can belong to multiple groups, and those groups typically have access to different security levels. Rather than check the groups to which a user belongs, and from that try to determine the security levels to which the user has access, you can use this function to check the security levels directly.
For more information about groups and security levels, see Group Account dialog.
Examples
The user “Bob” belongs to the groups “GroupA” and “GroupB”. GroupA has access to runtime levels 10 to 20, and GroupB has access to development levels 30 to 40. That means Bob has access to runtime security levels 10 to 20 and development security levels 30 to 40.
CheckSecurityLevel(17)
…it returns a value of 1, meaning that Bob has access.
CheckSecurityLevel(33,1)
…it again returns a value of 1.
CheckSecurityLevel(25,0)
…it returns a value of 0, meaning that Bob does not have access.