We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 293e745 commit ce7844dCopy full SHA for ce7844d
config/initializers/thredded.rb
@@ -156,3 +156,13 @@
156
#
157
# add in (must install separate gem (under development) as well):
158
# Thredded.notifiers = [Thredded::EmailNotifier.new, Thredded::PushoverNotifier.new(ENV['PUSHOVER_APP_ID'])]
159
+
160
+module AllowUsersToDeleteOwnTopics
161
+ def destroy?
162
+ super || @topic.user_id == @user.id
163
+ end
164
+end
165
166
+Rails.application.config.to_prepare do
167
+ Thredded::TopicPolicy.prepend AllowUsersToDeleteOwnTopics
168
0 commit comments