File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,15 +197,7 @@ def batch_assign_role_to_subjects_in_scope(
197197 role: The role to assign.
198198 """
199199 for subject in subjects :
200-
201- assert (
202- get_subject_role_assignments_in_scope (subject , scope )
203- == []
204- ), "Subject already has a role in the scope"
205-
206- enforcer .add_role_for_user_in_domain (
207- subject .subject_id , role .name , scope .scope_id
208- )
200+ assign_role_to_subject_in_scope (subject , role , scope )
209201
210202
211203def unassign_role_from_subject_in_scope (
@@ -234,7 +226,7 @@ def batch_unassign_role_from_subjects_in_scope(
234226 scope: The scope from which to unassign the role.
235227 """
236228 for subject in subjects :
237- enforcer . delete_roles_for_user_in_domain (subject , role . name , scope . scope_id )
229+ unassign_role_from_subject_in_scope (subject , role , scope )
238230
239231
240232def get_subject_role_assignments (subject : SubjectData ) -> list [RoleAssignmentData ]:
You can’t perform that action at this time.
0 commit comments