-
Notifications
You must be signed in to change notification settings - Fork 141
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
Allow multiple role identifiers for cloud volume #299
Allow multiple role identifiers for cloud volume #299
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.
This suggests to me that there's a problem with our configuration - we have a concept of a role that we haven't identified, that is the parent of these two other identifiers. Could this be addressed by adding a parent identifier?
a0b59e7
to
7f188b8
Compare
spec/lib/api/api_config_spec.rb
Outdated
let(:api_feature_identifiers) do | ||
collection_settings.each_with_object(Set.new) do |(_, cfg), set| | ||
set.add(cfg[:identifier]) if cfg[:identifier] | ||
add_identifier_to_set(cfg[:identifier], set) |
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.
Can't this line just be changed to:
Array(cfg[:identifier]).each { |id| set.add(id) }
Without introducing the add_identifier_to_set method.
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.
yes, sure, it is much better.
spec/lib/api/api_config_spec.rb
Outdated
@@ -29,7 +39,7 @@ | |||
cfg[action_type].each do |_, method_cfg| | |||
method_cfg.each do |action_cfg| | |||
next unless action_cfg[:identifier] | |||
Array(action_cfg[:identifier]).each { |id| set.add(id) } | |||
Array(action_cfg[:identifier]).each { |id| add_identifier_to_set(action_cfg[:identifier], set) } |
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.
probably don't need this as it already deals with the Array
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.
changed 👍
:identifier: ems_infra_show_list | ||
:identifier: | ||
- ems_infra_show_list | ||
- ems_block_storage_show_list |
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.
Are Block Storage Managers providers ? i.e. subclass of ExtManagementSystem or Provider ? If so then this change is fine, i.e. User is authorized to see both variants as per the miq product feature selections and should be here since they are both accessible via /api/providers.
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.
yes, exactly, it is:
irb(main):013:0> ExtManagementSystem > ManageIQ::Providers::StorageManager
true
Can show me an example of your idea? if so, it will cause that the added subtree will be displayed in the tree of product role feature when the role is edited and we don't need it. |
7f188b8
to
a6af758
Compare
Thanks @lpichler for updating and fixing this. LGTM!! 👍 @imtayadeway please take a 👀 Thanks! |
to put each identifier from the array to the result(returned in api_feature_identifiers)
a6af758
to
4202930
Compare
Checked commits lpichler/manageiq-api@a2a4e1c~...4202930 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
ping @imtayadeway |
@lpichler you could possibly add it to the new API-only section?
To me, this is an issue with DRY - the knowledge of how to authorize a user for this endpoint is now duplicated. Any attempt to work around this is only going to add complexity to the system, and it's complexity that we impose upon the user - I would much prefer we figure out a way to DRY this up in our configuration. |
…_for_cloud_volume Allow multiple role identifiers for cloud volume (cherry picked from commit aca3a26) https://bugzilla.redhat.com/show_bug.cgi?id=1552821
Gaprindashvili backport details:
|
pulled out from ManageIQ/manageiq#15249 - there is description
but the problem is solved only for storage managers.
@miq-bot add_label gaprindashvili/yes, blocker
links
https://bugzilla.redhat.com/show_bug.cgi?id=1538003
cc @gtanzillo
@miq-bot assign @abellotti