This repository was archived by the owner on Nov 11, 2019. It is now read-only.
shipit/api: authorization work#1870
Merged
Merged
Conversation
rail
reviewed
Feb 12, 2019
Contributor
Author
|
@marco-c @La0 could you also pass a review for this PR. i will shortly push to staging so you can really test it. the reason for involving you is that i refactor a bit the authentication part and while i'm sure i did it correctly i can never be 100%. that is why i would like additional review. also this PR might mess up some of your projects which makes it at least fair to bring it to your attention. |
La0
approved these changes
Feb 15, 2019
| if not flask_login.current_user.has_permissions(permissions): | ||
| user = flask_login.current_user.get_id() | ||
| user_permissions = flask_login.current_user.get_permissions() | ||
| diff = ' OR '.join([ |
Contributor
There was a problem hiding this comment.
Isn't there a function in taskcluster-client that does this ?
Contributor
Author
There was a problem hiding this comment.
yes, but we might not be using taskcluser for authorization. like we do in shipit/api.
|
|
||
| # we must require scope which depends on product | ||
| required_permission = f'{SCOPE_PREFIX}/schedule_phase/{phase.release.product}/{phase.name}' | ||
| if not current_user.has_permissions(required_permission): |
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 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.
No description provided.