-
Notifications
You must be signed in to change notification settings - Fork 5
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
add type query parameter to filter requested services/resource tree #471
Conversation
…apply it for UI rendering of highest priority permission (resolve #463)
… under resources endpoint + add test utils to retrieve perms from HTML resource-tree pages + define test validating displayed perms (fixes #463)
Codecov Report
@@ Coverage Diff @@
## master #471 +/- ##
==========================================
+ Coverage 79.28% 79.45% +0.16%
==========================================
Files 70 70
Lines 8836 8909 +73
Branches 1207 1211 +4
==========================================
+ Hits 7006 7079 +73
+ Misses 1550 1544 -6
- Partials 280 286 +6
Continue to review full report at Codecov.
|
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'm wondering what is changing exactly in the shown permission and found a typo. Else everything looks good.
@@ -465,11 +465,17 @@ def get_user_or_group_resources_permissions_dict(self, user_or_group_name, servi | |||
or :term:`Group` accordingly to specified arguments. | |||
""" | |||
if is_user: | |||
query = "?inherited=true" if is_inherit_groups_permissions else "" | |||
path = schemas.UserResourcesAPI.path.format(user_name=user_or_group_name) + query | |||
# because page can only show a single permission (per name/resource) at a time, apply resolution |
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.
What's the difference with before?
The single permission shown should be the effective, no?
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.
No. The displayed permission is either direct or inherited in the combobox, based on the checkbox "show intherited".
The effective permission is obtained by the test button next to it that transforms into checkmark/cross.
The problem was that given a resource X, a user member of both groups A and B, each with different permissions on X was not resolving the most important one to be displayed.
Cases where [(user, X, allow-match), (A, X, allowed-recurive), (B, X, deny-match)]
are applied would not be resolved and would simply show the last item in the HTML <select> <options>
(that's how it resolves which one to show when many are selected for single-select comboboxes).
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.
Hum that's right, we don't have a "word" for the "most important one". But I meant the "local effective", without considering the scope. Anyway, we now have the good behavior. Thank you!
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.
Indeed there is no 'term' in the glossary, but I refer to that concept as resolved
in docs.
It is present here: https://pavics-magpie.readthedocs.io/en/latest/permissions.html#types-of-permissions
Changes
type
query parameter to multiple requests returningServices
orResources
regrouped byServiceType
for a given
User
orGroup
in order to limit listing in responses and optimise some operations where only asubset of details are needed.
type
query to filterServiceType
, improvePermissions
listing in UI pages with faster processingbecause
Services
that are not required (since they are not currently being displayed by the tab-panel view) canbe skipped entirely, removing the need to compute their underlying
Resource
andPermissions
tree hierarchy.References