Skip to content

Commit 43da8fd

Browse files
committed
Mirror groups should remove any that are not in the claim
1 parent 91bb7c9 commit 43da8fd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

django_auth_adfs/backend.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,9 @@ def update_user_groups(self, user, claim_groups):
447447
for name in claim_groups
448448
if name not in existing_claimed_group_names
449449
]
450-
# Associate the users to all claimed groups
451-
user.groups.set(
452-
tuple(existing_claimed_groups) + tuple(new_claimed_groups)
453-
)
450+
# Set user's groups to all claimed groups (both existing and
451+
# newly created) and remove any that are not in the claim.
452+
user.groups.set(new_claimed_groups)
454453
else:
455454
# Associate the user to only existing claimed groups
456455
user.groups.set(existing_claimed_groups)

0 commit comments

Comments
 (0)