app/views/decidim/admin/users/index.html.erb in decidim-admin-0.11.2 vs app/views/decidim/admin/users/index.html.erb in decidim-admin-0.12.0.pre
- old
+ new
@@ -1,10 +1,12 @@
<div class="card">
<div class="card-divider">
<h2 class="card-title">
<%= t "decidim.admin.titles.users" %>
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.user.name", scope: "decidim.admin")), ["new", "user"], class: "button tiny button--title" %>
+ <% if allowed_to? :create, :admin_user %>
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.user.name", scope: "decidim.admin")), ["new", "user"], class: "button tiny button--title" %>
+ <% end %>
</h2>
</div>
<div class="card-section">
<div class="table-scroll">
<table class="table-list">
@@ -41,14 +43,14 @@
<%= l user.last_sign_in_at, format: :short %>
<% end %>
</td>
<td><%= l user.created_at, format: :short %></td>
<td class="table-list__actions">
- <% if can?(:invite, user) && user.invited_to_sign_up? %>
+ <% if allowed_to?(:invite, :admin_user, user: user) && user.invited_to_sign_up? %>
<%= icon_link_to "reload", ["resend_invitation", user], t("actions.resend_invitation", scope: "decidim.admin"), class: "resend-invitation", method: :post %>
<% end %>
- <% if can? :destroy, user %>
+ <% if allowed_to? :destroy, :admin_user, user: user %>
<%= icon_link_to "circle-x", user, t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
<% end %>
</td>
</tr>
<% end %>