Add revoke all blocks link

This commit is contained in:
Anton Khorev 2023-12-27 18:16:57 +03:00
parent f73b7205f4
commit 8682b58154
6 changed files with 55 additions and 1 deletions

View file

@ -61,7 +61,7 @@ class Ability
can [:index, :show, :resolve, :ignore, :reopen], Issue
can :create, IssueComment
can [:new, :create, :edit, :update, :destroy], Redaction
can [:new, :edit, :create, :update, :revoke], UserBlock
can [:new, :edit, :create, :update, :revoke, :revoke_all], UserBlock
end
if user.administrator?

View file

@ -101,6 +101,12 @@
</li>
<% end %>
<% if can?(:revoke_all, UserBlock) and @user.blocks.active.exists? %>
<li>
<%= link_to t(".revoke_all_blocks"), revoke_all_user_blocks_path(@user) %>
</li>
<% end %>
<% if can?(:create, UserBlock) %>
<li>
<%= link_to t(".create_block"), new_user_block_path(@user) %>