gitlab-org--gitlab-foss/app/finders/joined_groups_finder.rb

16 lines
345 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-09-07 08:29:19 -04:00
class JoinedGroupsFinder
def initialize(user)
@user = user
end
# Finds the groups of the source user, optionally limited to those visible to
# the current user.
def execute(current_user = nil)
2018-09-07 08:29:19 -04:00
@user.authorized_groups
.public_or_visible_to_user(current_user)
.order_id_desc
end
end