forked from External/greenlight
GRN2-xx: Admin actions are now dictated by the correct role permission (#1140)
* Admin actions are now dictated by the correct role permission * Rspec fix Co-authored-by: Jesus Federico <jesus@123it.ca>
This commit is contained in:
@ -309,7 +309,7 @@ class AdminsController < ApplicationController
|
||||
# Verifies that admin is an administrator of the user in the action
|
||||
def verify_admin_of_user
|
||||
redirect_to admins_path,
|
||||
flash: { alert: I18n.t("administrator.flash.unauthorized") } unless current_user.admin_of?(@user)
|
||||
flash: { alert: I18n.t("administrator.flash.unauthorized") } unless current_user.admin_of?(@user, "can_manage_users")
|
||||
end
|
||||
|
||||
# Creates the invite if it doesn't exist, or updates the updated_at time if it does
|
||||
|
Reference in New Issue
Block a user