django-rest-framework-docs icon indicating copy to clipboard operation
django-rest-framework-docs copied to clipboard

Support for permission classes specified using rest_condition

Open argoyal opened this issue 9 years ago • 0 comments

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

argoyal avatar Nov 26 '16 15:11 argoyal