r2lab is migrating from a previous depl. based on omf_sfa
[plcapi.git] / PLC / Methods / GetRoles.py
index 6826476..fb905e5 100644 (file)
@@ -2,26 +2,20 @@ 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):
     """
     Get an array of structs containing details about all roles.
     """
 
-    roles = ['admin', 'pi', 'user', 'tech']
+    roles = ['admin', 'pi', 'user', 'tech', 'node']
 
     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.items()) for role in roles]
-
-       return roles
+        return Roles(self.api)