9e6ceb06acef4bfbeece8c349e7c6eb08616bbbb
[plcapi.git] / PLC / Methods / GetRoles.py
1 # $Id$
2 from PLC.Faults import *
3 from PLC.Method import Method
4 from PLC.Parameter import Parameter, Mixed
5 from PLC.Roles import Role, Roles
6 from PLC.Auth import Auth
7
8 class GetRoles(Method):
9     """
10     Get an array of structs containing details about all roles.
11     """
12
13     roles = ['admin', 'pi', 'user', 'tech', 'node']
14
15     accepts = [
16         Auth()
17         ]
18
19     returns = [Role.fields]
20     
21     def call(self, auth):
22         return Roles(self.api)