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 ...@@ -283,7 +283,7 @@ module EE
prevent :read_group prevent :read_group
end end
rule { ip_enforcement_prevents_access & ~owner }.policy do rule { ip_enforcement_prevents_access & ~owner & ~auditor }.policy do
prevent :read_group prevent :read_group
end end
......
...@@ -366,7 +366,7 @@ module EE ...@@ -366,7 +366,7 @@ module EE
prevent :owner_access prevent :owner_access
end end
rule { ip_enforcement_prevents_access & ~admin }.policy do rule { ip_enforcement_prevents_access & ~admin & ~auditor }.policy do
prevent :read_project prevent :read_project
end end
......
...@@ -567,6 +567,12 @@ RSpec.describe GroupPolicy do ...@@ -567,6 +567,12 @@ RSpec.describe GroupPolicy do
it { is_expected.to be_allowed(:read_group) } it { is_expected.to be_allowed(:read_group) }
end end
context 'as auditor' do
let(:current_user) { create(:user, :auditor) }
it { is_expected.to be_allowed(:read_group) }
end
end end
end end
end end
......
...@@ -439,6 +439,12 @@ RSpec.describe ProjectPolicy do ...@@ -439,6 +439,12 @@ RSpec.describe ProjectPolicy do
context 'with admin disabled' do context 'with admin disabled' do
it { is_expected.to be_disallowed(:read_project) } it { is_expected.to be_disallowed(:read_project) }
end end
context 'with auditor' do
let(:current_user) { create(:user, :auditor) }
it { is_expected.to be_allowed(:read_project) }
end
end 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