Skip to content
Snippets Groups Projects
Commit 24cb05be authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Don't manage groups in auth middleware for robot users

Robot user group memberships are entirely managed within GraceDB and
should not be added/removed based on request header content.
parent cd9d3745
No related branches found
No related tags found
No related merge requests found
......@@ -135,7 +135,10 @@ class LigoAuthMiddleware(MiddlewareMixin):
stored_user_group_names = set([g.name for g in user.groups.all()])
# Take necessary action if the group sets differ
if user_group_names != stored_user_group_names:
# NOTE: we only do this for human users. Robot user group
# memberships are fully managed within GraceDB.
if (not hasattr(user, 'robotuser') and
user_group_names != stored_user_group_names):
# If the user has acquired a new group membership, add it.
for group_name in user_group_names - stored_user_group_names:
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment