Skip to content
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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions config/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1795,10 +1795,14 @@
:collection_actions:
:get:
- :name: read
:identifier: ems_infra_show_list
:identifier:
- ems_infra_show_list
- ems_block_storage_show_list
Copy link
Member

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.

Copy link
Contributor Author

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

:post:
- :name: query
:identifier: ems_infra_show_list
:identifier:
- ems_infra_show_list
- ems_block_storage_show_list
- :name: create
:identifier: ems_infra_new
- :name: edit
Expand All @@ -1810,7 +1814,9 @@
:resource_actions:
:get:
- :name: read
:identifier: ems_infra_show
:identifier:
- ems_infra_show
- ems_block_storage_show
:post:
- :name: edit
:identifier: ems_infra_edit
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/api/api_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

let(:api_feature_identifiers) do
collection_settings.each_with_object(Set.new) do |(_, cfg), set|
set.add(cfg[:identifier]) if cfg[:identifier]
Array(cfg[:identifier]).each { |id| set.add(id) }
keys = [:collection_actions, :resource_actions, :subcollection_actions, :subresource_actions]
Array(cfg[:subcollections]).each do |s|
keys << "#{s}_subcollection_actions" << "#{s}_subresource_actions"
Expand Down