From 83579695593c941ab39ab545c10a7f711bf715fc Mon Sep 17 00:00:00 2001 From: ThibG Date: Tue, 15 Dec 2020 17:23:58 +0100 Subject: Fix admins being able to suspend their instance actor (#14567) * Fix admin being able to suspend their own instance account * Add text about the instance's own actor in admin view * Change instance actor notice from flash message to template * Do not list local instance actor in account moderation list --- app/policies/account_policy.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/policies/account_policy.rb') diff --git a/app/policies/account_policy.rb b/app/policies/account_policy.rb index 262ada42e..672e1786b 100644 --- a/app/policies/account_policy.rb +++ b/app/policies/account_policy.rb @@ -14,7 +14,7 @@ class AccountPolicy < ApplicationPolicy end def suspend? - staff? && !record.user&.staff? + staff? && !record.user&.staff? && !record.instance_actor? end def destroy? @@ -62,6 +62,6 @@ class AccountPolicy < ApplicationPolicy end def memorialize? - admin? && !record.user&.admin? + admin? && !record.user&.admin? && !record.instance_actor? end end -- cgit