summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-10 22:08:11 +0100
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-13 19:08:04 +0100
commit42fcd3881fcece5c9bd4b720460d6cade573b151 (patch)
treeacabaaa610da27413ffdd7b5a0dd1610d3772a4c /app/finders
parent065de4ab791373f7e6b8b5d3b73b5fe7c9e8e7c5 (diff)
downloadgitlab-ce-42fcd3881fcece5c9bd4b720460d6cade573b151.tar.gz
External Users
The user has the rights of a public user execpt it can never create a project, group, or team. Also it cant view internal projects.
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/projects_finder.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb
index 0e5a8f5ee0f..711d9019a3d 100644
--- a/app/finders/projects_finder.rb
+++ b/app/finders/projects_finder.rb
@@ -51,13 +51,12 @@ class ProjectsFinder
end
def all_projects(current_user)
- if current_user
- [
- current_user.authorized_projects,
- public_and_internal_projects
- ]
+ return [Project.public_only] unless current_user
+
+ if current_user.external?
+ [current_user.authorized_projects, public_projects]
else
- [Project.public_only]
+ [current_user.authorized_projects, public_and_internal_projects]
end
end