pundit: convert forum topics / forum posts to pundit.

Fix it being possible for users to delete or undelete their own forum
posts and topics, even if they were deleted by a mod.
This commit is contained in:
evazion
2020-03-16 02:42:54 -05:00
parent b3ff08fedf
commit db63b6d44f
18 changed files with 262 additions and 170 deletions

View File

@@ -13,7 +13,7 @@
<%= dtext_field "forum_post", "body", :classes => "autocomplete-mentions", :input_name => "forum_topic[original_post_attributes][body]", :value => forum_topic.original_post.body, :input_id => "forum_post_body_for_#{forum_topic.original_post.id}", :preview_id => "dtext-preview-for-#{forum_topic.original_post.id}" %>
<% end %>
<% if CurrentUser.is_moderator? %>
<% if policy(forum_topic).moderate? %>
<%= f.input :min_level, :include_blank => false, :collection => available_min_user_levels %>
<%= f.input :is_sticky, :label => "Sticky" %>
<%= f.input :is_locked, :label => "Locked" %>