Improvements on core.authorization and permission backend#714
Merged
Improvements on core.authorization and permission backend#714
Conversation
9acd0ff to
74af727
Compare
12 tasks
| self.get_prefixed_userid = functools.partial(prefixed_userid, request) | ||
|
|
||
| self._check_permission = request.registry.permission.check_permission | ||
| permission = request.registry.permission |
Contributor
Author
|
@Natim feedback? |
Member
|
I've read the code I understand that rather than using the get_bound_permissions function you prepare it and then you pass its result. I think I would need some more explanation but it seems a good refactor to me. |
Contributor
Author
yes, that is it! actually, each backend implementation was resolving the result of this callback the same way! so it makes much more sense to call it before leveraging the backends. It makes the code simpler to read IMO. Plus, it gives us a consistent way of fetching the permissions for several objects, necessary for #653 and #694 :) Win-Win :) |
Contributor
Author
Member
|
r+ |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

get_bound_permissionsget_accessible_objects()to obtain every objects in a single call (c.f. GET /permissions endpoint)get_objects_permissions()to retrieve the permissions set for a list of objects ids