-
Notifications
You must be signed in to change notification settings - Fork 357
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
Dashboard services - add missing rbac #3901
Conversation
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.
:s/\([A-Z][a-zA-Z:]\+\).find(\([^)]*\))/find_record_with_rbac(\1, \2)
@himdel The CI failures seem related:
|
Aah thanks, forgot to include the mixin :) Added. |
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.
@himdel CheckedIdMixin
is defined inside the Mixins
module so you might wanna do include Mixins::CheckedIdMixin
instead.
Also is there any convention/rule that prevent us from including this on the super class DashboardService
that I am not aware of? pure curiosity 😄
+ include CheckedIdMixin to be able to use find_record_with_rbac
@fbladilo Thanks for noticing, fixed :)
Well, DashboardService is not the class using it. So we can add it somewhere which will not use it and rely on other code inheriting from there .. or we can add it to the places actually using it, reducing confusion and the burden for future refactoring :). But you're right, there's no technical reason this would not work on DashboardService now. |
Checked commits https://github.com/himdel/manageiq-ui-classic/compare/2a67164f151d5acc4d2d4c4bdcd34d48107b0637~...d020a346eacce2dcb56d37e314e488783c099b38 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
All the dashboard services have missing RBAC now:
ContainerProjectDashboard does:
and is initialized from ContainerDashboardController like...
called as
(
project_data
being the endpoint).Similar thing happens in the other dashboard service/controller pairs.
Fixing that :)
The change is just
:s/\([A-Z][a-zA-Z:]\+\).find(\([^)]*\))/find_record_with_rbac(\1, \2)
Thanks @skateman, @felipedf for noticing.