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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
ad283fbb
Commit
ad283fbb
authored
Mar 13, 2019
by
Małgorzata Ksionek
Committed by
Rémy Coutable
Mar 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update group policy to reflect all the requirements
parent
f06a649c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
app/policies/group_policy.rb
app/policies/group_policy.rb
+2
-1
changelogs/unreleased/modify_group_policy.yml
changelogs/unreleased/modify_group_policy.yml
+5
-0
spec/features/security/group/private_access_spec.rb
spec/features/security/group/private_access_spec.rb
+5
-4
No files found.
app/policies/group_policy.rb
View file @
ad283fbb
...
...
@@ -26,7 +26,7 @@ class GroupPolicy < BasePolicy
condition
(
:can_change_parent_share_with_group_lock
)
{
can?
(
:change_share_with_group_lock
,
@subject
.
parent
)
}
condition
(
:has_projects
)
do
GroupProjectsFinder
.
new
(
group:
@subject
,
current_user:
@user
,
options:
{
include_subgroups:
true
}).
execute
.
any?
GroupProjectsFinder
.
new
(
group:
@subject
,
current_user:
@user
,
options:
{
include_subgroups:
true
,
only_owned:
true
}).
execute
.
any?
end
condition
(
:has_clusters
,
scope: :subject
)
{
clusterable_has_clusters?
}
...
...
@@ -55,6 +55,7 @@ class GroupPolicy < BasePolicy
rule
{
has_projects
}.
policy
do
enable
:read_list
enable
:read_label
enable
:read_group
end
rule
{
has_access
}.
enable
:read_namespace
...
...
changelogs/unreleased/modify_group_policy.yml
0 → 100644
View file @
ad283fbb
---
title
:
Allow project members to see private group if the project is in the group namespace
merge_request
:
author
:
type
:
fixed
spec/features/security/group/private_access_spec.rb
View file @
ad283fbb
...
...
@@ -27,7 +27,7 @@ describe 'Private Group access' do
it
{
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
group
)
}
it
{
is_expected
.
to
be_
deni
ed_for
(
project_guest
)
}
it
{
is_expected
.
to
be_
allow
ed_for
(
project_guest
)
}
it
{
is_expected
.
to
be_denied_for
(
:user
)
}
it
{
is_expected
.
to
be_denied_for
(
:external
)
}
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
...
...
@@ -42,7 +42,7 @@ describe 'Private Group access' do
it
{
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
group
)
}
it
{
is_expected
.
to
be_
deni
ed_for
(
project_guest
)
}
it
{
is_expected
.
to
be_
allow
ed_for
(
project_guest
)
}
it
{
is_expected
.
to
be_denied_for
(
:user
)
}
it
{
is_expected
.
to
be_denied_for
(
:external
)
}
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
...
...
@@ -58,7 +58,7 @@ describe 'Private Group access' do
it
{
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
group
)
}
it
{
is_expected
.
to
be_
deni
ed_for
(
project_guest
)
}
it
{
is_expected
.
to
be_
allow
ed_for
(
project_guest
)
}
it
{
is_expected
.
to
be_denied_for
(
:user
)
}
it
{
is_expected
.
to
be_denied_for
(
:external
)
}
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
...
...
@@ -73,7 +73,7 @@ describe 'Private Group access' do
it
{
is_expected
.
to
be_allowed_for
(
:developer
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:reporter
).
of
(
group
)
}
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
group
)
}
it
{
is_expected
.
to
be_
deni
ed_for
(
project_guest
)
}
it
{
is_expected
.
to
be_
allow
ed_for
(
project_guest
)
}
it
{
is_expected
.
to
be_denied_for
(
:user
)
}
it
{
is_expected
.
to
be_denied_for
(
:external
)
}
it
{
is_expected
.
to
be_denied_for
(
:visitor
)
}
...
...
@@ -96,6 +96,7 @@ describe 'Private Group access' do
describe
'GET /groups/:path for shared projects'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
before
do
Projects
::
GroupLinks
::
CreateService
.
new
(
project
,
...
...
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