diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-09-15 14:37:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-15 14:37:58 +0200 |
commit | ed099d8bdc5b3d9e7df7ce5358441887e6bb7e48 (patch) | |
tree | e55ddfa97c0c9932e35c8ffd7cb59434084bd478 /app/policies | |
parent | bbcbf12215a5ec69362a769c1bae9c630eda0ed4 (diff) |
Change account suspensions to be reversible by default (#14726)
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/account_policy.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/policies/account_policy.rb b/app/policies/account_policy.rb index 9c145979d..1b105e92a 100644 --- a/app/policies/account_policy.rb +++ b/app/policies/account_policy.rb @@ -17,6 +17,10 @@ class AccountPolicy < ApplicationPolicy staff? && !record.user&.staff? end + def destroy? + record.suspended? && record.deletion_request.present? && admin? + end + def unsuspend? staff? end |