+# Get all currently registered roles
+g_role_names = [ role['name'] for role in GetRoles()]
+g_role_names.sort()
+
+def SetRole(level, role):
+ global g_role_names
+ if role not in g_role_names:
+ AddRole(level, role)
+ g_role_names.append(role)
+ g_role_names.sort()
+