-
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
Use base class only when it is supported by direct rbac #14665
Use base class only when it is supported by direct rbac #14665
Conversation
it is fixing that specialized class model is passed but rbac is returing objects with specialized class model's baseclass. for example: Rbac.filtered_object(MiqAeDomain.first, :user => User.first) before: returned object is MiqAeNamespace (as parent of MiqAeDomain) after: returned object is MiqAeDomain
@kbrock @gtanzillo question: it looks like we have some cases when klass dont have method find (https://github.com/ManageIQ/manageiq/blob/master/lib/rbac/filterer.rb#L212 and https://github.com/ManageIQ/manageiq/blob/master/lib/rbac/filterer.rb#L202 ) Are you aware of such case of rbac call ?
then it should be
I did not find such class method in
some maybe we can remove these lines: |
spec/lib/rbac/filterer_spec.rb
Outdated
@@ -41,6 +41,18 @@ | |||
end | |||
end | |||
|
|||
context 'when class is not participate in RBAC' do |
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.
when class does not participate...
9a0e6e7
to
e314f31
Compare
Checked commits lpichler/manageiq@f32c23c~...e314f31 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
/cc @mkanoor I was always confused why |
bump ;-) this is crucial for RBAC fixes in the classic-ui as we heavily depend on please, review |
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.
LGTM 👍
…ported_by_rbac Use base class only when it is supported by direct rbac (cherry picked from commit 81cf67c)
Fine backport details:
|
Use base only when it is supported by direct rbac
it is fixing that specialized class model is passed but
rbac is returing objects with the model's
base_class
.for example:
Rbac.filtered_object(MiqAeDomain.first, :user => User.first)
before:
returned object is
MiqAeNamespace
(as parent ofMiqAeDomain
)after:
returned object is
MiqAeDomain
About fix
I did similar thing as we have here for format of rbac calling:
Rbac.search(:targets => MiqAeDomain, :user => User.first)
@miq-bot add_label rbac, core, bug
cc @PanSpagetka @martinpovolny
@miq-bot assign @gtanzillo