pundit: convert misc privilege checks in views to pundit.

This commit is contained in:
evazion
2020-03-20 04:13:57 -05:00
parent 7f742242e4
commit 79e7b9308e
3 changed files with 22 additions and 13 deletions

View File

@@ -27,8 +27,11 @@
<% end %>
<% end %>
<% if CurrentUser.user.is_moderator? %>
<% if policy(CurrentUser.user).promote? %>
<%= subnav_link_to "Promote", edit_admin_user_path(@user) %>
<% end %>
<% if policy(Ban.new(user: @user)).create? %>
<% if @user.is_banned? && @user.recent_ban.present? %>
<%= subnav_link_to "Unban", ban_path(@user.recent_ban) %>
<% else %>