mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:34:31 +08:00
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:
@ -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? ||
|
||||
|
Reference in New Issue
Block a user