<% end %>
</td>
<td><%= link_to t(".show"), block %></td>
- <td><% if current_user && (current_user.id == block.creator_id ||
- current_user.id == block.revoker_id) %><%= link_to t(".edit"), edit_user_block_path(block) %><% end %></td>
+ <td><% if can?(:edit, block) %><%= link_to t(".edit"), edit_user_block_path(block) %><% end %></td>
<% if can?(:revoke, UserBlock) %>
<td><% if block.active? %><%= link_to t(".revoke"), revoke_user_block_path(block) %><% end %></td>
<% end %>
current_user.id == @user_block.revoker_id) ||
can?(:revoke, UserBlock) && @user_block.active? %>
<div>
- <% if current_user && (current_user.id == @user_block.creator_id ||
- current_user.id == @user_block.revoker_id) %>
+ <% if can?(:edit, @user_block) %>
<%= link_to t(".edit"), edit_user_block_path(@user_block), :class => "btn btn-outline-primary" %>
<% end %>
<% if can?(:revoke, UserBlock) && @user_block.active? %>
block = create(:user_block, :creator => creator_user)
session_for(other_moderator_user)
- check_block_buttons block, :revoke => 1
+ check_block_buttons block, :edit => 1, :revoke => 1
session_for(creator_user)
check_block_buttons block, :edit => 1, :revoke => 1