Skip to content

Commit

Permalink
Allow Husbandry members to edit litters, subjects, breeding pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
rossant committed Mar 20, 2024
1 parent 5679f68 commit 2c5a8d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alyx/alyx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def has_change_permission(self, request, obj=None):
# 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':
if obj.__class__.__name__ in ('Litter', 'Subject', 'BreedingPair'):
return True

# Find subject associated to the object.
Expand Down Expand Up @@ -650,6 +650,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 2c5a8d3

Please sign in to comment.