-
Notifications
You must be signed in to change notification settings - Fork 33
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
Refactor roleneed roleid #94
base: master
Are you sure you want to change the base?
Refactor roleneed roleid #94
Conversation
def query_filter(self, identity=None, **kwargs): | ||
"""Filters for current identity.""" | ||
for need in identity.provides: | ||
if need.method == "role" and need.value == self.action.value: |
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.
shouldn't this be
if need.method == "role" and need.value == self.action.value: | |
if need.method == "action" and need.value == self.action.value: |
?
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.
I see from the tests that you add a role with a name equal to the action name....I might miss some knowledge on how the action roles work, but isn't creating an action redundant if we only check a role?
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.
Resolving as it was explained IRL
tests/conftest.py
Outdated
"username": "user_moderator", | ||
"email": "[email protected]", | ||
"profile": { | ||
"full_name": "Mr", |
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.
"full_name": "Mr", | |
"full_name": "Moderator", |
22325a2
to
c0ae04e
Compare
c0ae04e
to
5b5aade
Compare
closes inveniosoftware/invenio-access#205
ATTENTION
This PR must be merged first.
If you review this PR, review only the last commit.