diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-03-18 01:42:46 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-18 01:42:46 +0300 |
commit | 0a7f7161198feaa9a4cae7c16669a0e6187aed33 (patch) | |
tree | 445dcbd9f473be2af293a299b634525725a70666 /app/finders/joined_groups_finder.rb | |
parent | a18ac62756573a2da2c42ca50b6f30033be6fa63 (diff) |
Code fixes
Diffstat (limited to 'app/finders/joined_groups_finder.rb')
-rw-r--r-- | app/finders/joined_groups_finder.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/finders/joined_groups_finder.rb b/app/finders/joined_groups_finder.rb index ff744689e3d..867eb661682 100644 --- a/app/finders/joined_groups_finder.rb +++ b/app/finders/joined_groups_finder.rb @@ -12,7 +12,7 @@ class JoinedGroupsFinder # # Returns an ActiveRecord::Relation. def execute(current_user = nil) - if current_user && !current_user.external? + if current_user relation = groups_visible_to_user(current_user) else relation = public_groups @@ -29,7 +29,7 @@ class JoinedGroupsFinder # "@user" that "current_user" also has access to. def groups_visible_to_user(current_user) base = @user.authorized_groups.visible_to_user(current_user) - extra = public_and_internal_groups + extra = current_user.external? ? public_groups : public_and_internal_groups union = Gitlab::SQL::Union.new([base.select(:id), extra.select(:id)]) Group.where("namespaces.id IN (#{union.to_sql})") |