Skip to content

Commit

Permalink
Source/Collection DELETE head exports not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Feb 4, 2021
1 parent 1f37237 commit 3bbc13f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/common/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ def delete(self, request, *args, **kwargs): # pylint: disable=unused-argument
user = request.user
version = self.get_object()

if version.is_head:
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)

permitted = user.is_staff or user.is_superuser or user.is_admin_for(version)

if not permitted:
Expand Down

0 comments on commit 3bbc13f

Please sign in to comment.