Skip to content
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

Permissions: Add ~ operator to permissions composition #6361

merged 1 commit into from Feb 25, 2019


Copy link

@adrienbrunet adrienbrunet commented Dec 18, 2018

This PR add support for ~ "NOT" operator.
Recent updates from @xordoquy add support for & "AND" and | "OR" operator with permissions. I felt ~ "NOT" was missing.

We could now do something like permission_classes = (~cond1 & cond2).

I updated only a very tiny bit of the documentation.

If we keep going further with this approach, I don't know if the mentions of "Composed Permissions" and "Rest Condition" will stay relevant. More documentation on how to compose permissions could be a good thing, it is a bit discrete right now.

@xordoquy xordoquy added this to the 3.9.1 Release milestone Dec 19, 2018
Copy link

xordoquy commented Dec 19, 2018

Looks good at first, will have a closer look at it.

auvipy approved these changes Feb 14, 2019
Copy link

@carltongibson carltongibson left a comment

Nice addition. Thanks!

(Ref docs: PRs working those up a bit always welcome. 🙂)

@carltongibson carltongibson merged commit 2daf6f1 into encode:master Feb 25, 2019
1 check passed
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

5 participants