X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAdmGetPersonSites.py;h=79324f8b4596293d0d2dcc58a7f0668250f424e4;hb=2696eec3582eb1b1092d0a98c863a040f6aa2af4;hp=c75a43212514458b286a79bd061c9af26a6254c2;hpb=a6661b42891465a1539dff364436a00c1576f077;p=plcapi.git diff --git a/PLC/Methods/AdmGetPersonSites.py b/PLC/Methods/AdmGetPersonSites.py index c75a432..79324f8 100644 --- a/PLC/Methods/AdmGetPersonSites.py +++ b/PLC/Methods/AdmGetPersonSites.py @@ -3,10 +3,12 @@ from PLC.Method import Method 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. @@ -15,15 +17,17 @@ class AdmGetPersonSites(Method): 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 @@ -31,7 +35,7 @@ class AdmGetPersonSites(Method): if not persons: raise PLCInvalidArgument, "No such account" - person = persons.values()[0] + person = persons[0] # Authenticated function assert self.caller is not None