debian-mirror-gitlab/lib/constraints/group_url_constrainer.rb
2017-08-17 22:00:37 +05:30

9 lines
264 B
Ruby

class GroupUrlConstrainer
def matches?(request)
id = request.params[:group_id] || request.params[:id]
return false unless DynamicPathValidator.valid_namespace_path?(id)
Group.find_by_full_path(id, follow_redirects: request.get?).present?
end
end