diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-11-14 16:55:31 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-11-23 14:08:36 +0200 |
commit | 6683fdcfb0ae4ceb368b6f5f63dde0a10a4a3e1b (patch) | |
tree | 7530562c2e0702df3e74fc8ca8288e2e3f4ef0a2 /lib/constraints/user_url_constrainer.rb | |
parent | b1b5060dbad15975184ec20a1914c7c48fc804db (diff) | |
download | gitlab-ce-6683fdcfb0ae4ceb368b6f5f63dde0a10a4a3e1b.tar.gz |
Add nested groups support to the routingdz-allow-nested-group-routing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/constraints/user_url_constrainer.rb')
-rw-r--r-- | lib/constraints/user_url_constrainer.rb | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/constraints/user_url_constrainer.rb b/lib/constraints/user_url_constrainer.rb index 4d722ad5af2..9ab5bcb12ff 100644 --- a/lib/constraints/user_url_constrainer.rb +++ b/lib/constraints/user_url_constrainer.rb @@ -1,15 +1,5 @@ -require_relative 'constrainer_helper' - class UserUrlConstrainer - include ConstrainerHelper - def matches?(request) - id = extract_resource_path(request.path) - - if id =~ Gitlab::Regex.namespace_regex - User.find_by('lower(username) = ?', id.downcase).present? - else - false - end + User.find_by_username(request.params[:username]).present? end end |