Commit 2c680468 authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak

Merge branch '300455-auditor-role-not-bypassing-sso-enforce-with-ip-restrictions-on' into 'master'

Exempt auditor from ip restriction

See merge request gitlab-org/gitlab!55073
parents 411e8901 08a9cbb5
...@@ -288,7 +288,7 @@ module EE ...@@ -288,7 +288,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
......
---
title: Exempt auditor from ip restriction
merge_request: 55073
author:
type: changed
...@@ -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