system.vision.getRoles
Backwards Compatibility
This function replaces system.security.getRoles. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility.
This function is used in Python Scripting.
Descriptionβ
Finds the roles that the currently logged in user has, returns them as a Python tuple of strings.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.vision.getRoles()
Parametersβ
Nothing
Returnsβ
Tuple - A list of the roles (strings) that are assigned to the current user.
Scopeβ
Vision Client
Code Examplesβ
Example #1
# This would run on a button to prevent certain users from opening a window
if "Supervisor" in system.vision.getRoles():
system.vision.openWindow("ManagementOnly")
else:
system.vision.showError("You don't have sufficient privileges to continue")