Roles editor bug fix (#721)

* Allow users with just the manage users permission to edit roles

* Allow users with just the manage users permission to edit roles

* Fix update recordings bug
This commit is contained in:
shawn-higgins1
2019-08-01 16:53:55 -04:00
committed by Jesus Federico
parent 60f5cd5c81
commit e1fdc8f58b
7 changed files with 18 additions and 12 deletions

View File

@ -260,8 +260,8 @@ class UsersController < ApplicationController
# Updates as user's roles
def update_roles
# Check that the user can edit roles
if current_user.highest_priority_role.can_edit_roles
# Check that the user can manage users
if current_user.highest_priority_role.can_manage_users
new_roles = params[:user][:role_ids].split(' ').map(&:to_i)
old_roles = @user.roles.pluck(:id)