mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: New 'Reviewable' model to make reviewable items generic
Includes support for flags, reviewable users and queued posts, with REST API backwards compatibility. Co-Authored-By: romanrizzi <romanalejandro@gmail.com> Co-Authored-By: jjaffeux <j.jaffeux@gmail.com>
This commit is contained in:
@@ -192,10 +192,11 @@ module PostGuardian
|
||||
end
|
||||
|
||||
def can_delete_post_action?(post_action)
|
||||
# You can only undo your own actions
|
||||
is_my_own?(post_action) && not(post_action.is_private_message?) &&
|
||||
return false unless is_my_own?(post_action) && !post_action.is_private_message?
|
||||
|
||||
# Bookmarks do not have a time constraint
|
||||
return true if post_action.is_bookmark?
|
||||
|
||||
# Make sure they want to delete it within the window
|
||||
post_action.created_at > SiteSetting.post_undo_action_window_mins.minutes.ago
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user