forked from External/greenlight
Fixed 500 caused by editting a user when not allowed to (#2108)
This commit is contained in:
@ -223,8 +223,8 @@ class UsersController < ApplicationController
|
||||
|
||||
# Checks that the user is allowed to edit this user
|
||||
def check_admin_of
|
||||
redirect_to current_user.main_room if current_user &&
|
||||
@user != current_user &&
|
||||
!current_user.admin_of?(@user, "can_manage_users")
|
||||
redirect_to root_path if current_user &&
|
||||
@user != current_user &&
|
||||
!current_user.admin_of?(@user, "can_manage_users")
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user