0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/app/jobs/regular/bump_topic.rb
Mark VanLandingham 1171b86bb7
FEATURE: Allow topic_timers_allowed_groups to manage topic timers (#41126)
Previously managing topic timers was staff + TL4 only. This moves the
logic to a group site setting so that other groups can set timers.
2026-06-23 12:46:56 -05:00

15 lines
437 B
Ruby
Vendored

# frozen_string_literal: true
module Jobs
class BumpTopic < ::Jobs::TopicTimerBase
def execute_timer_action(topic_timer, topic)
guardian = Guardian.new(topic_timer.user)
if guardian.can_create_post_on_topic?(topic) || guardian.can_set_topic_timer?(topic)
topic.add_small_action(Discourse.system_user, "autobumped", nil, bump: true)
end
topic_timer.trash!(Discourse.system_user)
end
end
end