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