Commit 4b94a392 authored by Gosia Ksionek's avatar Gosia Ksionek Committed by Markus Koller

Resolve Admins cannot access projects with IP restriction

parent dfbba26d
...@@ -368,7 +368,7 @@ module EE ...@@ -368,7 +368,7 @@ module EE
prevent :owner_access prevent :owner_access
end end
rule { ip_enforcement_prevents_access }.policy do rule { ip_enforcement_prevents_access & ~admin }.policy do
prevent :read_project prevent :read_project
end end
......
---
title: Allow admins to see project despite of ip restriction set on a group level
merge_request: 34086
author:
type: fixed
...@@ -427,6 +427,14 @@ RSpec.describe ProjectPolicy do ...@@ -427,6 +427,14 @@ RSpec.describe ProjectPolicy do
let(:range) { '10.0.0.0/8' } let(:range) { '10.0.0.0/8' }
it { is_expected.to be_disallowed(:read_project) } it { is_expected.to be_disallowed(:read_project) }
context 'with admin enabled', :enable_admin_mode do
it { is_expected.to be_allowed(:read_project) }
end
context 'with admin disabled' do
it { is_expected.to be_disallowed(: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