Skip to content

Commit

Permalink
Change spec:tenant-admin can not see admin-role as well as superadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Feb 27, 2017
1 parent 788f6ae commit 4fc245a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/lib/rbac/filterer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,19 +341,23 @@ def get_rbac_results_for_and_expect_objects(klass, expected_objects)
FactoryGirl.create(:miq_user_role, :name => MiqUserRole::SUPER_ADMIN_ROLE_NAME)
end

let!(:administrator_user_role) do
FactoryGirl.create(:miq_user_role, :name => MiqUserRole::ADMIN_ROLE_NAME)
end

let(:group) do
FactoryGirl.create(:miq_group, :tenant => default_tenant, :miq_user_role => tenant_administrator_user_role)
end

let!(:user) { FactoryGirl.create(:user, :miq_groups => [group]) }

it 'can see all roles expect to EvmRole-super_administrator' do
expect(MiqUserRole.count).to eq(2)
expect(MiqUserRole.count).to eq(3)
get_rbac_results_for_and_expect_objects(MiqUserRole, [tenant_administrator_user_role])
end

it 'can see all groups expect to group with role EvmRole-super_administrator' do
expect(MiqUserRole.count).to eq(2)
expect(MiqUserRole.count).to eq(3)
get_rbac_results_for_and_expect_objects(MiqGroup, [group])
end
end
Expand Down

0 comments on commit 4fc245a

Please sign in to comment.