app/views/decidim/admin/attachments/index.html.erb in decidim-admin-0.11.2 vs app/views/decidim/admin/attachments/index.html.erb in decidim-admin-0.12.0.pre

- old
+ new

@@ -1,10 +1,10 @@ <div class='card' id="attachments"> <div class="card-divider"> <h2 class="card-title"> <%= t(".attachments_title") %> - <% if can? :create, authorization_object %> + <% if allowed_to? :create, :attachment %> <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.attachment.name", scope: "decidim.admin")), url_for(action: :new), class: "button tiny button--title new" %> <% end %> </h2> </div> @@ -35,14 +35,14 @@ </td> <td> <%= number_to_human_size(attachment.file_size) %> </td> <td class="table-list__actions"> - <% if can? :update, authorization_object %> + <% if allowed_to? :update, :attachment, attachment: attachment %> <%= icon_link_to "pencil", edit_polymorphic_path([attached_to, attachment]), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %> <% end %> - <% if can? :destroy, authorization_object %> + <% if allowed_to? :destroy, :attachment, attachment: attachment %> <%= icon_link_to "circle-x", polymorphic_path([attached_to, attachment]), 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 %>