Added ability to change user roles in admin/users index

This commit is contained in:
2024-09-18 10:42:12 +02:00
parent ace50699fb
commit a169b8fae8
6 changed files with 35 additions and 15 deletions

View File

@@ -1,2 +1,7 @@
class Admin::UserPolicy < ApplicationPolicy
skip_pre_check :allow_admins, only: :change_role?
def change_role?
user.admin? and user != record
end
end