Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 authored Mar 22, 2024
2 parents 16ec938 + 2c5a8d3 commit 287d427
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions alyx/alyx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,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__ in ('Litter', 'Subject', 'BreedingPair'):
return True

# Find subject associated to the object.
if hasattr(obj, 'responsible_user'):
subj = obj
Expand Down Expand Up @@ -640,6 +649,7 @@ class BaseRestPublicPermission(permissions.BasePermission):
"""
The purpose is to prevent public users from interfering in any way using writable methods
"""

def has_permission(self, request, view):
if request.method == 'GET':
return True
Expand Down

0 comments on commit 287d427

Please sign in to comment.