1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter
4 from PLC.Roles import Role, Roles
5 from PLC.Auth import PasswordAuth
7 class AdmGetAllRoles(Method):
9 Return all possible roles as a struct:
11 {'10': 'admin', '20': 'pi', '30': 'user', '40': 'tech'}
13 Note that because of XML-RPC marshalling limitations, the keys to
14 this struct are string representations of the integer role
18 roles = ['admin', 'pi', 'user', 'tech']
19 accepts = [PasswordAuth()]
23 roles_list = Roles(self.api).values()
26 for role in roles_list:
28 roles_dict[str(role['role_id'])] = role['name']