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
79497949
Commit
79497949
authored
Feb 06, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List all groups/projects for auditors on explore pages
parent
37bcdc91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
app/finders/group_projects_finder.rb
app/finders/group_projects_finder.rb
+1
-1
lib/gitlab/visibility_level.rb
lib/gitlab/visibility_level.rb
+13
-1
No files found.
app/finders/group_projects_finder.rb
View file @
79497949
...
...
@@ -18,7 +18,7 @@ class GroupProjectsFinder < UnionFinder
projects
=
[]
if
current_user
if
@group
.
users
.
include?
(
current_user
)
||
current_user
.
admin_or_auditor?
if
@group
.
users
.
include?
(
current_user
)
projects
<<
@group
.
projects
unless
only_shared
projects
<<
@group
.
shared_projects
unless
only_owned
else
...
...
lib/gitlab/visibility_level.rb
View file @
79497949
...
...
@@ -13,7 +13,19 @@ module Gitlab
scope
:public_and_internal_only
,
->
{
where
(
visibility_level:
[
PUBLIC
,
INTERNAL
]
)
}
scope
:non_public_only
,
->
{
where
.
not
(
visibility_level:
PUBLIC
)
}
scope
:public_to_user
,
->
(
user
)
{
user
&&
!
user
.
external
?
public_and_internal_only
:
public_only
}
scope
:public_to_user
,
->
(
user
)
do
if
user
if
user
.
admin_or_auditor?
all
elsif
!
user
.
external?
public_and_internal_only
else
public_only
end
else
public_only
end
end
end
PRIVATE
=
0
unless
const_defined?
(
:PRIVATE
)
...
...
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