X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=PLC%2FMethods%2FGetRoles.py;h=7d7c264a3361059c2b6ca1d7c338c1fae5c393e1;hb=77723d1447871a37e8af77146b9586dfd3d11394;hp=084350f8678c2a7b14598e1b7e164afa8dd35a72;hpb=575d12792527ae98ff6ed22de3594ca39e03bc84;p=plcapi.git diff --git a/PLC/Methods/GetRoles.py b/PLC/Methods/GetRoles.py index 084350f..7d7c264 100644 --- a/PLC/Methods/GetRoles.py +++ b/PLC/Methods/GetRoles.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Roles import Role, Roles -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth class GetRoles(Method): """ @@ -12,16 +12,11 @@ class GetRoles(Method): roles = ['admin', 'pi', 'user', 'tech'] accepts = [ - PasswordAuth() + Auth() ] returns = [Role.fields] + def call(self, auth): - - roles = Roles(self.api).values() - - #turn each role into a real dict - roles = [dict(role) for role in roles] - - return roles + return Roles(self.api)