django-rest-framework-docs
django-rest-framework-docs copied to clipboard
Support for permission classes specified using rest_condition
Basically the idea of this change is that if the permission classes is specified not by adding the permissions classes in the tuple but by using a third party resource providing us with conditional usage of permissions, the get_permissions_class fails, because this conditional permission creates an object for the condition.
For eg. if we have a view specified as.
from rest_condition import OR
class ABCView(ModelViewSet):
permission_classes = (OR(Permission1, Permission2),)
"""Some other stuff"""
The error in this case comes out to be Condition object has no attribute name, which makes sense.
Kindly look into the issue if this is mergeable.
Maybe there is a better approach to do this....
Thanks! Arpit