From 0a7f7161198feaa9a4cae7c16669a0e6187aed33 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Thu, 17 Mar 2016 19:42:46 -0300 Subject: Code fixes --- app/finders/groups_finder.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/finders/groups_finder.rb') 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 -- cgit v1.2.3