from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetPersonRoles(Method):
"""
+ Deprecated. See GetPersons.
+
Return the roles that the specified person has as a struct:
{'10': 'admin', '30': 'user', '20': 'pi', '40': 'tech'}
identifiers.
"""
+ status = "deprecated"
+
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email'])
]
returns = dict
- # Stupid return type, and can get now roles through
- # AdmGetPersons().
- status = "useless"
+ object_type = 'Person'
def call(self, auth, person_id_or_email):
# Get account information
if not persons:
raise PLCInvalidArgument, "No such account"
- person = persons.values()[0]
+ person = persons[0]
# Authenticated function
assert self.caller is not None