Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a5115661
Commit
a5115661
authored
Feb 24, 2021
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exempt auditor from ip restriction
parent
d4fd5bd2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
ee/app/policies/ee/group_policy.rb
ee/app/policies/ee/group_policy.rb
+1
-1
ee/app/policies/ee/project_policy.rb
ee/app/policies/ee/project_policy.rb
+1
-1
ee/spec/policies/group_policy_spec.rb
ee/spec/policies/group_policy_spec.rb
+6
-0
ee/spec/policies/project_policy_spec.rb
ee/spec/policies/project_policy_spec.rb
+6
-0
No files found.
ee/app/policies/ee/group_policy.rb
View file @
a5115661
...
...
@@ -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
...
...
ee/app/policies/ee/project_policy.rb
View file @
a5115661
...
...
@@ -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
...
...
ee/spec/policies/group_policy_spec.rb
View file @
a5115661
...
...
@@ -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
...
...
ee/spec/policies/project_policy_spec.rb
View file @
a5115661
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment