pundit: convert misc privilege checks in views to pundit.
This commit is contained in:
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user