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

@@ -11,7 +11,7 @@
Categories:
<%= link_to "All", forum_topics_path %>,
<%= link_to "New", forum_topics_path(search: { is_read: false }) %>,
<% if CurrentUser.is_moderator? %>
<% if policy(ForumTopic).moderate? %>
<%= link_to "Private", forum_topics_path(search: { is_private: true }) %>,
<% end %>
<%= ForumTopic::CATEGORIES.map {|id, name| link_to_unless_current(name, forum_topics_path(:search => {:category_id => id}))}.join(", ").html_safe %>