summaryrefslogtreecommitdiff
path: root/lib/constraints/group_url_constrainer.rb
blob: 2bf973a73dafc6d2dde83de95060da8892e4367b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require_relative 'constrainer_helper'

class GroupUrlConstrainer
  include ConstrainerHelper

  def matches?(request)
    id = extract_resource_path(request.path)

    if id =~ Gitlab::Regex.namespace_regex
      !!Group.find_by_path(id)
    else
      false
    end
  end
end