Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-13 12:05:32 +0300
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-13 21:10:33 +0300
commit76eeb316df2f256d0d3c41d97421f709a21a02a8 (patch)
tree23687791d2889f98c6acf2ea1611ef86c2f5e55b /app/finders/projects_finder.rb
parentfc8d64b3a0fc5aeb048b2bce79b2ae93a4fcc798 (diff)
Create an external users tab on Admin user list
Also incorporates the review into this, mainly spec changes.
Diffstat (limited to 'app/finders/projects_finder.rb')
-rw-r--r--app/finders/projects_finder.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb
index 711d9019a3d..4a6c2fbd71c 100644
--- a/app/finders/projects_finder.rb
+++ b/app/finders/projects_finder.rb
@@ -40,18 +40,23 @@ class ProjectsFinder
private
def group_projects(current_user, group)
- if current_user
+ return [group.projects.public_only] unless current_user
+
+ if current_user.external?
[
group_projects_for_user(current_user, group),
- group.projects.public_and_internal_only
+ group.projects.public_only
]
else
- [group.projects.public_only]
+ [
+ group_projects_for_user(current_user, group),
+ group.projects.public_and_internal_only
+ ]
end
end
def all_projects(current_user)
- return [Project.public_only] unless current_user
+ return [public_projects] unless current_user
if current_user.external?
[current_user.authorized_projects, public_projects]