-
Notifications
You must be signed in to change notification settings - Fork 115
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
Require Admin function decorators enhance #1016
Merged
MariusWirtz
merged 24 commits into
cubewise-code:master
from
adscheevel:require_admin_enhance_202312
Jan 15, 2024
Merged
Require Admin function decorators enhance #1016
MariusWirtz
merged 24 commits into
cubewise-code:master
from
adscheevel:require_admin_enhance_202312
Jan 15, 2024
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
adding other admin types require
exceptions for other admin types
adding other admin types
other NotAdmin exceptions
update_or_create_hierarchy_from_dataframe requires both data and ops admin
Nice work @adscheevel. I agree we can skip creating test cases for the new decorators. |
MariusWirtz
reviewed
Jan 15, 2024
MariusWirtz
reviewed
Jan 15, 2024
MariusWirtz
reviewed
Jan 15, 2024
MariusWirtz
requested changes
Jan 15, 2024
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.
Looking good!
Only the api/v1/
should be skipped in the URL for compliance with recently merged v12 feature branch.
Then we can merge
Co-authored-by: Marius Wirtz <MariusWirtz2@gmail.com>
Co-authored-by: Marius Wirtz <MariusWirtz2@gmail.com>
Co-authored-by: Marius Wirtz <MariusWirtz2@gmail.com>
MariusWirtz
approved these changes
Jan 15, 2024
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.
These commits address issue #1001 related to the require_admin decorator in TM1py being more restrictive than the tm1 object security model. I've added a comment on that issue and will duplicate here with the required type of admin access for each function in the various TM1py service files. I tested each one with the specified access, but did not develop any test cases to be merged into the repo.
I've added
is_data_admin, is_security_admin, and is_operations_admin
decorators to the user.py object for easy checking when usingtm1.security.get_user('<user>')
or e.g.tm1.whoami.is_operations_admin
in addition to assigning the property to the connection object in RestService which is the primary property for the@require_...
decorators.The update includes additional exception messages when the necessary type of admin access is not possessed.
TM1py functions that require some sort of admin and the level of admin required: