2016-11-07 08:16:04 -05:00
|
|
|
require_relative 'constrainer_helper'
|
2016-10-06 08:14:24 -04:00
|
|
|
|
2016-11-07 08:16:04 -05:00
|
|
|
class GroupUrlConstrainer
|
|
|
|
include ConstrainerHelper
|
|
|
|
|
|
|
|
def matches?(request)
|
|
|
|
id = extract_resource_path(request.path)
|
|
|
|
|
|
|
|
if id =~ Gitlab::Regex.namespace_regex
|
2016-11-08 07:32:42 -05:00
|
|
|
Group.find_by(path: id).present?
|
2016-11-07 08:16:04 -05:00
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
2016-10-06 08:14:24 -04:00
|
|
|
end
|
|
|
|
end
|