FEATURE: Allow admins to permanently delete posts and topics (#14406)

Sometimes administrators want to permanently delete posts and topics
from the database. To make sure that this is done for a good reasons,
administrators can do this only after one minute has passed since the
post was deleted or immediately if another administrator does it.
This commit is contained in:
Bianca Nenciu
2021-10-13 12:53:23 +03:00
committed by GitHub
parent 76c9de2d04
commit c4843fc1c1
27 changed files with 290 additions and 99 deletions

View File

@ -172,6 +172,10 @@ class Guardian
can_do?(:delete, obj)
end
def can_permanently_delete?(obj)
can_do?(:permanently_delete, obj)
end
def can_moderate?(obj)
obj && authenticated? && !is_silenced? && (
is_staff? ||