@@ -39,11 +39,6 @@ class GroupTypes(Enum):
3939 group = 4
4040
4141
42- class RoleTypes (Enum ):
43- admin = 1
44- productAdmin = 2
45-
46-
4742class IfAlreadyExistsOptions (Enum ):
4843 ignoreIfAlreadyExists = 1
4944 updateIfAlreadyExists = 2
@@ -151,7 +146,7 @@ def add_to_groups(self, groups=None, all_groups=False, group_type=None):
151146 :param groups: list of group names the user should be added to
152147 :param all_groups: a boolean meaning add to all (don't specify groups or group_type in this case)
153148 :param group_type: the type of group (defaults to "group")
154- :return: the User, so you can do User(...).add_to_groups(...).add_role(... )
149+ :return: the User, so you can do User(...).add_to_groups(...).???( )
155150 """
156151 if all_groups :
157152 if groups or group_type :
@@ -175,7 +170,7 @@ def remove_from_groups(self, groups=None, all_groups=False, group_type=None):
175170 :param groups: list of group names the user should be removed from
176171 :param all_groups: a boolean meaning remove from all (don't specify groups or group_type in this case)
177172 :param group_type: the type of group (defaults to "group")
178- :return: the User, so you can do User(...).remove_from_groups(...).add_role (...)
173+ :return: the User, so you can do User(...).remove_from_groups(...).??? (...)
179174 """
180175 if all_groups :
181176 if groups or group_type :
@@ -193,38 +188,6 @@ def remove_from_groups(self, groups=None, all_groups=False, group_type=None):
193188 glist = {group_type .name : [group for group in groups ]}
194189 return self .append (remove = glist )
195190
196- def add_role (self , groups = None , role_type = RoleTypes .admin ):
197- """
198- Make user have a role (typically PLC admin) with respect to some PLC groups.
199- :param groups: list of group names the user should have this role for
200- :param role_type: the role (defaults to "admin")
201- :return: the User, so you can do User(...).add_role(...).add_to_groups(...)
202- """
203- if not groups :
204- raise ArgumentError ("You must specify groups to which to add the role for this user" )
205- if role_type in RoleTypes .__members__ :
206- role_type = RoleTypes [role_type ]
207- if role_type not in RoleTypes :
208- raise ArgumentError ("You must specify a RoleType value for argument role_type" )
209- glist = {role_type .name : [group for group in groups ]}
210- return self .append (addRoles = glist )
211-
212- def remove_role (self , groups = None , role_type = RoleTypes .admin ):
213- """
214- Remove user from a role (typically admin) of some groups.
215- :param groups: list of group names the user should NOT have this role for
216- :param role_type: the type of role (defaults to "admin")
217- :return: the User, so you can do User(...).remove_role(...).remove_from_groups(...)
218- """
219- if not groups :
220- raise ArgumentError ("You must specify groups from which to remove the role for this user" )
221- if role_type in RoleTypes .__members__ :
222- role_type = RoleTypes [role_type ]
223- if role_type not in RoleTypes :
224- raise ArgumentError ("You must specify a RoleType value for argument role_type" )
225- glist = {role_type .name : [group for group in groups ]}
226- return self .append (removeRoles = glist )
227-
228191 def remove_from_organization (self , delete_account = False ):
229192 """
230193 Remove a user from the organization's list of visible users. Optionally also delete the account.
0 commit comments