-
Notifications
You must be signed in to change notification settings - Fork 897
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
Fix tag filtering for indirect RBAC #15088
Fix tag filtering for indirect RBAC #15088
Conversation
filtered_ids = ids of items determined from filters like belongs to filter, managed filter, self_service user filter tenant_filter_ids = additional filter based on tenant hiearchy (only for indirect rbac) before: there was a union for filtered_ids and tenant_filter which was selected improperly because both sets of ids are basically expressing limitation so there have to find intersection. example: Tenant: MyCompany-> Tenant1 -> Tenant2 User is tight with group(with Tenant2) and role with tag filter A Vm1 Belongs to Tenant2 and is not tagged with any tag Vm2 Belongs to Tenant2 and is tagged with tag A the user have to see only VMs from his tenant and from these VMs only which are tagged with tag A ———— this covers when filtered_ids and tenant_filter_ids are not empty
when filtered_ids is not nil and tenant_filter_ids is nil then return filtered_ids when filtered_ids is nil and tenant_filter_ids is nil then return nil
Checked commits lpichler/manageiq@7f18378~...e4a78ce with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@lpichler unrecognized command 'remove', ignoring... Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone |
@miq-bot remove_label wip |
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.
👍 Looks good!
…t_rbac Fix tag filtering for indirect RBAC (cherry picked from commit 2facb0b) https://bugzilla.redhat.com/show_bug.cgi?id=1451395
Fine backport details:
|
…t_rbac Fix tag filtering for indirect RBAC (cherry picked from commit 2facb0b) https://bugzilla.redhat.com/show_bug.cgi?id=1451396
Euwe backport details:
|
in #14095 was added tenant scope filter
for tenant restriction for associated models(indirect RBAC).
In method
combine_filtered_ids
was the issue thatids
determined by tag filters, belongs filters and self-services users were joined toids
determined by tenant scope filter.But both sets of
ids
express limitation so they have to be combined by intersection.Example:
Tenant:
MyCompany->
Tenant1 ->
Tenant2
User is tight with group(with Tenant2) and role with
filtering by tag 'my_tag'
Vm1 Belongs to Tenant2 and is not tagged with any tag
Vm2 Belongs to Tenant2 and is tagged with tag 'my_tag'
the user have to see only VMs from his tenant and
from these VMs he will only VMs which are tagged with tag 'my_tag'.
Links
https://bugzilla.redhat.com/show_bug.cgi?id=1448994
#14095
@miq-bot add_label fine/yes
@miq-bot add_label euwe/yes
@miq-bot assign @gtanzillo
cc @kbrock
@miq-bot add_label bug, rbac, blocker