pundit: convert misc privilege checks in views to pundit.
This commit is contained in:
@@ -2,15 +2,17 @@
|
||||
<%= quick_search_form_for(:body_matches, forum_posts_path, "forum posts") %>
|
||||
<%= subnav_link_to "Listing", forum_topics_path %>
|
||||
|
||||
<% if CurrentUser.is_member? %>
|
||||
<% if policy(ForumTopic).create? %>
|
||||
<%= subnav_link_to "New", new_forum_topic_path %>
|
||||
<% end %>
|
||||
<% if policy(ForumTopic).mark_all_as_read? %>
|
||||
<%= subnav_link_to "Mark all as read", mark_all_as_read_forum_topics_path, :method => :post, :"data-shortcut" => "shift+r" %>
|
||||
<% end %>
|
||||
|
||||
<% if @forum_topic %>
|
||||
<%= subnav_link_to "Request alias/implication", new_bulk_update_request_path(bulk_update_request: { forum_topic_id: @forum_topic.id }) %>
|
||||
<% else %>
|
||||
<%= subnav_link_to "Request alias/implication", new_bulk_update_request_path %>
|
||||
<% end %>
|
||||
<% if @forum_topic && policy(BulkUpdateRequest.new(forum_topic: @forum_topic)).create? %>
|
||||
<%= subnav_link_to "Request alias/implication", new_bulk_update_request_path(bulk_update_request: { forum_topic_id: @forum_topic.id }) %>
|
||||
<% else %>
|
||||
<%= subnav_link_to "Request alias/implication", new_bulk_update_request_path %>
|
||||
<% end %>
|
||||
|
||||
<%= subnav_link_to "Search", search_forum_posts_path %>
|
||||
|
||||
Reference in New Issue
Block a user