diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-13 12:05:32 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-13 21:10:33 +0300 |
commit | 76eeb316df2f256d0d3c41d97421f709a21a02a8 (patch) | |
tree | 23687791d2889f98c6acf2ea1611ef86c2f5e55b /app/finders | |
parent | fc8d64b3a0fc5aeb048b2bce79b2ae93a4fcc798 (diff) |
Create an external users tab on Admin user list
Also incorporates the review into this, mainly spec changes.
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/projects_finder.rb | 13 |
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] |