This commit was manufactured by cvs2svn to create branch
[plcapi.git] / PLC / Methods / SliceUserAdd.py
1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Persons import Person, Persons
5 from PLC.Slices import Slice, Slices
6 from PLC.Auth import Auth
7 from PLC.Methods.AddPersonToSlice import AddPersonToSlice
8
9 class SliceUserAdd(AddPersonToSlice):
10     """
11     Deprecated. See AddPersonToSlice.
12
13     """
14
15     status = "deprecated"
16
17     roles = ['admin', 'pi']
18
19     accepts = [
20         Auth(),
21         Slice.fields['name'],
22         [Person.fields['email']],
23         ]
24
25     returns = Parameter(int, '1 if successful')
26
27     object_type = 'Slice'
28
29     def call(self, auth, slice_name, user_list):
30
31         for user in user_list:
32             AddPersonToSlice.call(self, auth, user, slice_name)
33
34         return 1