3 from PLC.Method import Method
4 from PLC.Parameter import Parameter, Mixed
5 from PLC.Filter import Filter
6 from PLC.Auth import Auth
7 from PLC.Slices import Slice, Slices
8 from PLC.Persons import Person, Persons
9 from PLC.Methods.GetSlices import GetSlices
10 from PLC.Methods.GetPersons import GetPersons
12 class SliceListUserSlices(GetSlices, GetPersons):
14 Deprecated. Can be implemented with GetPersons and GetSlices.
16 Return the slices the specified user (by email address) is a member of.
18 Users may only query slices of which they are members. PIs may
19 query any of the slices at their sites. Admins may query any
20 slice. If a slice that cannot be queried is specified in
21 slice_filter, details about that slice will not be returned.
26 roles = ['admin', 'pi', 'user']
30 Person.fields['email']
33 returns = [Slice.fields['name']]
36 def call(self, auth, email):
38 persons = GetPersons.call(self, auth, [email])
42 slice_ids = person['slice_ids']
46 slices = GetSlices.call(self, auth, slice_ids)
47 slice_names = [slice['name'] for slice in slices]