-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #73
Merged
Merged
Permissions #73
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
Updated permission names, added utility function check_permissions which checks if user has required permissions based on provided resource and permission requirements, renamed check_permission to compare_permissions
Removed permission check dependencies, added http wrapper for resource accessors
Added permission check to actions using new check_permission function
check_permissions raises UserNotAuthorized from ResourceExceptions, so even though the permission is checked inside workspace, it will not raise WorkspaceExceptions
Changed required permissions from add_members to get_members
check_permissions does not return anything but raises an exception in case user does not have the required permission, so the check must be made using try-catch block
Changed old permission set_policy to the new update_policies
Added case when user does not provide account_id in update_policy request, with the else statement, the route will find current user's policy
The new policy action will return the users policy even if the user does not have permission to get_policies
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.
Permissions overhaul. This PR adds new function
check_permissions
to the Permission module. This functions can be used to check if the current user has required permissions in the provided resource. The old permission check based on operation_id was removed along with related dependencies. The Actions were updated to utilize the new function to check permissions.