Open
Description
Checklist
- I have verified that that issue exists against the
master
branch of Django REST framework. - I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- This is not a usage question. (Those should be directed to the discussion group instead.)
- This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
- I have reduced the issue to the simplest possible case.
- I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
Steps to reproduce
I've two custom permissions :
class PermissionA(permissions.BasePermission):
message = "Custom Message A"
def has_permission(self, request, view):
return False
class PermissionB(permissions.BasePermission):
message = "Custom Message B"
def has_permission(self, request, view):
return False
They are added into a view like that: permission_classes = (PermissionA&PermissionB,)
Expected behavior
The view should displays "Custom Message A"
Actual behavior
The view displays "You do not have permission to perform this action."
As soon as I change the permission_classes
to PermissionA
or PermissionB
the custom message is displayed