Commit 7bec95a9 authored by Markus Koller's avatar Markus Koller

Merge branch '220409-admins-cannot-access-projects-with-ip-restriction' into 'master'

Resolve Admins cannot access projects with IP restriction

See merge request gitlab-org/gitlab!34086
parents 399cc167 4b94a392
......@@ -368,7 +368,7 @@ module EE
prevent :owner_access
end
rule { ip_enforcement_prevents_access }.policy do
rule { ip_enforcement_prevents_access & ~admin }.policy do
prevent :read_project
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
let(:range) { '10.0.0.0/8' }
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
......
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