from PLC.Parameter import Parameter, Mixed
from PLC.Persons import Person, Persons
from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
class AdmGetPersonSites(Method):
"""
+ Deprecated. See GetPersons.
+
Returns the sites that the specified person is associated with as
an array of site identifiers.
themselves and others at their sites.
"""
+ status = "deprecated"
+
roles = ['admin', 'pi', 'user', 'tech']
accepts = [
- PasswordAuth(),
+ Auth(),
Mixed(Person.fields['person_id'],
Person.fields['email'])
]
- returns = [Site.fields['site_id']]
+ returns = Person.fields['site_ids']
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