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:
authorFelipe Artur <felipefac@gmail.com>2016-03-18 01:42:46 +0300
committerFelipe Artur <felipefac@gmail.com>2016-03-18 01:42:46 +0300
commit0a7f7161198feaa9a4cae7c16669a0e6187aed33 (patch)
tree445dcbd9f473be2af293a299b634525725a70666 /app/finders/groups_finder.rb
parenta18ac62756573a2da2c42ca50b6f30033be6fa63 (diff)
Code fixes
Diffstat (limited to 'app/finders/groups_finder.rb')
-rw-r--r--app/finders/groups_finder.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/finders/groups_finder.rb b/app/finders/groups_finder.rb
index ce62f5e762f..30698f80231 100644
--- a/app/finders/groups_finder.rb
+++ b/app/finders/groups_finder.rb
@@ -14,9 +14,17 @@ class GroupsFinder
def all_groups(current_user)
if current_user
- [current_user.authorized_groups, Group.unscoped.public_and_internal_only]
+ user_groups(current_user)
else
[Group.unscoped.public_only]
end
end
+
+ def user_groups(current_user)
+ if current_user.external?
+ [current_user.authorized_groups, Group.unscoped.public_only]
+ else
+ [current_user.authorized_groups, Group.unscoped.public_and_internal_only]
+ end
+ end
end