FEATURE: rate limit post deletions to 50 per day
This commit is contained in:
parent
4ca09599af
commit
c352f8eb15
|
@ -266,7 +266,10 @@ class PostsController < ApplicationController
|
|||
|
||||
def destroy
|
||||
post = find_post_from_params
|
||||
RateLimiter.new(current_user, "delete_post", 3, 1.minute).performed! unless current_user.staff?
|
||||
unless current_user.staff?
|
||||
RateLimiter.new(current_user, "delete_post", 3, 1.minute).performed!
|
||||
RateLimiter.new(current_user, "delete_post", 50, 1.day).performed!
|
||||
end
|
||||
|
||||
guardian.ensure_can_delete!(post)
|
||||
|
||||
|
|
Loading…
Reference in New Issue