This repository has been archived by the owner on Mar 28, 2019. It is now read-only.
Check permissions on incoming requests #291
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
almet
force-pushed
the
permissions-context-factory
branch
from
June 8, 2015 15:30
ee9b091
to
a294690
Compare
almet
changed the title
[DO NOT MERGE] Permissions context factory
Permissions context factory
Jun 9, 2015
Otherwise, it's required to extend the service argument, which adds complexity to the API.
Now it will use the dynamic permission system by default.
""" | ||
raise NotImplementedError | ||
|
||
def object_permission_principals(self, object_id, permission): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to get_ace_principals
almet
changed the title
Permissions context factory
Check permissions on incoming requests
Jun 9, 2015
from cliquet import utils | ||
from cliquet.initialization import ( # NOQA | ||
initialize, initialize_cliquet, install_middlewares) | ||
|
||
# Main Cliquet logger. | ||
logger = structlog.get_logger() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that #102 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just to make flake8 happy (otherwise imports are after an instruction)
This avoids passing around information to the authorization policy when it's not necessary. Here, at the definition time, the function is curried with the known arguments. From a review by @leplatrem.
The former could be a boolean flag. Here it's explicit it is doing an operation. From a review by @leplatrem
Rather than using a string, which is error prone, having a constant allows to catch errors earlier in the dev process.
almet
added a commit
that referenced
this pull request
Jun 10, 2015
…tory Check permissions on incoming requests
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds permissions check to cliquet applications:
dynamic
;To review: