system.security.getRoles

Description

Finds the roles that the currently logged in user has, returns them as a Python tuple of strings.

Syntax

system.security. getRoles()

  • Parameters

None

  • Returns

PyTuple - A list of the roles (strings) that are assigned to the current user.

  • Scope

All

Code Examples
Code Snippet
#This would run on a button to prevent certain users from opening a window
if "Supervisor" in system.security.getRoles():
system.nav.openWindow("ManagementOnly")
else:
system.gui.errorBox("You don't have sufficient privileges to continue")