Skip to content

Commit

Permalink
Hack: following a request from Charu R, allow the husbandry user grou…
Browse files Browse the repository at this point in the history
…p to modify litters
  • Loading branch information
rossant committed Mar 13, 2024
1 parent 4a9c323 commit 84d3f21
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions alyx/alyx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,15 @@ def has_change_permission(self, request, obj=None):
return True
if request.user.is_superuser:
return True

# [CR 2024-03-12]
# HACK: following a request by Charu R from cortexlab, we authorize all users in the
# special Husbandry group to edit litters.
husbandry = 'husbandry' in ', '.join(_.name.lower() for _ in request.user.groups.all())
if husbandry:
if obj.__class__.__name__ == 'Litter':
return True

# Find subject associated to the object.
if hasattr(obj, 'responsible_user'):
subj = obj
Expand Down

0 comments on commit 84d3f21

Please sign in to comment.