<tbody id="resources-tbody">
  <% if @roles.empty? %>
    <tr>
      <td class="no_record_found" colspan="<%= policy(@roles).update? ? '4' : '3' %>"> <%= t('views.index.no_record_found')%></td>
    </tr>
  <% else %>
    <% @roles.each do |role| %>
      <tr>
        <td>
          <% if policy(role).update? %>
            <%= link_to role.name, edit_role_path(role) %>
          <% else %>
            <%= role.name %>
          <% end %>
        </td>
        <td><%= role.author %></td>
        <td><%= role.access_level_humanize %></td>
        <% if policy(role).update? %>
          <td>
            <%= link_to 'Editar', edit_role_path(role), class: "btn btn-success" %>
            <%= link_to 'Excluir', role_path(role), class: "btn btn-danger", method: "delete", data: { confirm: "Tem certeza?" } %>
          </td>
        <% end %>
      </tr>
    <% end %>
  <% end %>
</tbody>
