diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-05-03 20:33:01 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-05-05 22:11:58 +0300 |
commit | ca5c762cf577838a98c0ba96ce20b5f1d5dafc91 (patch) | |
tree | 4c9a8c50c18e075ce9b3d0dc1fc3843bbacdf366 /app/controllers/users_controller.rb | |
parent | 72872ee2136436e48ce394268fc8bfb8a2118810 (diff) |
Refactor
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6b6b3b20a8d..d7c1241698a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -94,11 +94,9 @@ class UsersController < ApplicationController private def authorize_read_user! - if can?(current_user, :read_user, user) - ensure_canonical_path(user.namespace, params[:username]) - else - render_404 - end + render_404 unless can?(current_user, :read_user, user) + + ensure_canonical_path(user.namespace, params[:username]) end def user |