From 671929ed1f9cb2e87422e92867bc7e69a372204e Mon Sep 17 00:00:00 2001 From: lpichler Date: Tue, 6 Mar 2018 14:36:51 +0100 Subject: [PATCH] Add ConfigurationScriptSource to RBAC --- lib/rbac/filterer.rb | 1 + spec/lib/rbac/filterer_spec.rb | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/rbac/filterer.rb b/lib/rbac/filterer.rb index b343e613eca..c7fa4537b80 100644 --- a/lib/rbac/filterer.rb +++ b/lib/rbac/filterer.rb @@ -13,6 +13,7 @@ class Filterer CloudVolume ConfigurationProfile ConfigurationScriptBase + ConfigurationScriptSource ConfiguredSystem Container ContainerBuild diff --git a/spec/lib/rbac/filterer_spec.rb b/spec/lib/rbac/filterer_spec.rb index 2a24c870532..d568bad42a4 100644 --- a/spec/lib/rbac/filterer_spec.rb +++ b/spec/lib/rbac/filterer_spec.rb @@ -137,6 +137,17 @@ def combine_filtered_ids(user_filtered_ids, belongsto_filtered_ids, managed_filt tagged_group.save! end + context 'searching for instances of ConfigurationScriptSource' do + let!(:configuration_script_source) { FactoryGirl.create_list(:embedded_ansible_configuration_script_source, 2).first } + + it 'lists only tagged ConfigurationScriptSources' do + configuration_script_source.tag_with('/managed/environment/prod', :ns => '*') + + results = described_class.search(:class => ManageIQ::Providers::EmbeddedAutomationManager::ConfigurationScriptSource, :user => user).first + expect(results).to match_array [configuration_script_source] + end + end + context 'searching for instances of AuthKeyPair' do let!(:auth_key_pair_cloud) { FactoryGirl.create_list(:auth_key_pair_cloud, 2).first }