Skip to content

Conversation

argoyal
Copy link

@argoyal argoyal commented Nov 26, 2016

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

Copy link

@dalexander-trc dalexander-trc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a problem for me, applying this easy fix gets me past the "Condition object has no attribute name" error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants