debian-mirror-gitlab/app/finders/group_finder.rb
2017-08-17 22:00:37 +05:30

18 lines
273 B
Ruby

class GroupFinder
include Gitlab::Allowable
def initialize(current_user)
@current_user = current_user
end
def execute(*params)
group = Group.find_by(*params)
if can?(@current_user, :read_group, group)
group
else
nil
end
end
end