Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support for permission classes specified using rest_condition #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
argoyal wants to merge 2 commits into manosim:master
base: master
Choose a base branch
Loading
from argoyal:master
Open

Support for permission classes specified using rest_condition #148

argoyal wants to merge 2 commits into manosim:master from argoyal:master

Conversation

Copy link

@argoyal argoyal commented Nov 26, 2016
edited
Loading

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

dalexander-trc reacted with thumbs up emoji
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
Reviewers
1 more reviewer

@dalexander-trc dalexander-trc dalexander-trc approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /