Commit 7ae26fde authored by Tugce Nur Tas's avatar Tugce Nur Tas Committed by Tuğçe Nur Taş
Browse files

adapt user policy, superadmin is not authorized to delete other superadmins

parent 11f1c41f
......@@ -31,6 +31,6 @@ class UserPolicy < ApplicationPolicy
end
def destroy?
@current_user.admin_or_superadmin? && @current_user != @user
@current_user.superadmin? && !@user.superadmin?
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment