Skip to content

Commit

Permalink
Merge pull request #19356 from jdeubel/add-cloud_volume_snapshot-to-rbac
Browse files Browse the repository at this point in the history
Adding Volume Snapshot (CloudVolumeSnapshot) to RBAC

(cherry picked from commit 68a06a3)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1773630
  • Loading branch information
gtanzillo authored and simaishi committed Nov 18, 2019
1 parent 2442fef commit 079f7d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rbac/filterer.rb
Expand Up @@ -11,6 +11,7 @@ class Filterer
CloudSubnet
CloudTenant
CloudVolume
CloudVolumeSnapshot
ConfigurationProfile
ConfigurationScriptBase
ConfigurationScriptSource
Expand Down
18 changes: 18 additions & 0 deletions spec/lib/rbac/filterer_spec.rb
Expand Up @@ -310,6 +310,24 @@ def combine_filtered_ids(user_filtered_ids, belongsto_filtered_ids, managed_filt
expect(results).to match_array [owner_tenant]
end
end

context 'searching for instances of CloudVolumeSnapshot' do
let!(:csv) { FactoryBot.create_list(:cloud_volume_snapshot, 2).first }

before do
csv.tag_with('/managed/environment/prod', :ns => '*')
end

it 'lists only tagged CloudVolumeSnapshot' do
results = described_class.search(:class => CloudVolumeSnapshot, :user => user).first
expect(results).to match_array [csv]
end

it 'lists only all CloudVolumeSnapshot' do
results = described_class.search(:class => CloudVolumeSnapshot, :user => admin_user).first
expect(results).to match_array CloudVolumeSnapshot.all
end
end
end

context 'with virtual custom attributes' do
Expand Down

0 comments on commit 079f7d3

Please sign in to comment.