summaryrefslogtreecommitdiff
path: root/lib/constraints/group_url_constrainer.rb
blob: 0ea2f97352d6dfde7bd853e1cbb0339075e24033 (plain)
1
2
3
4
5
6
7
8
9
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