Commit a5115661 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Exempt auditor from ip restriction

parent d4fd5bd2
......@@ -283,7 +283,7 @@ module EE
prevent :read_group
end
rule { ip_enforcement_prevents_access & ~owner }.policy do
rule { ip_enforcement_prevents_access & ~owner & ~auditor }.policy do
prevent :read_group
end
......
......@@ -366,7 +366,7 @@ module EE
prevent :owner_access
end
rule { ip_enforcement_prevents_access & ~admin }.policy do
rule { ip_enforcement_prevents_access & ~admin & ~auditor }.policy do
prevent :read_project
end
......
......@@ -567,6 +567,12 @@ RSpec.describe GroupPolicy do
it { is_expected.to be_allowed(:read_group) }
end
context 'as auditor' do
let(:current_user) { create(:user, :auditor) }
it { is_expected.to be_allowed(:read_group) }
end
end
end
end
......
......@@ -439,6 +439,12 @@ RSpec.describe ProjectPolicy do
context 'with admin disabled' do
it { is_expected.to be_disallowed(:read_project) }
end
context 'with auditor' do
let(:current_user) { create(:user, :auditor) }
it { is_expected.to be_allowed(:read_project) }
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment