From 97ec551178591ea9f59744f53c7aadcaad5e679a Mon Sep 17 00:00:00 2001 From: Bertocq Date: Wed, 24 Jan 2018 16:51:31 +0100 Subject: [PATCH] Correctly check if user can destroy a document --- app/views/documents/_document.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/documents/_document.html.erb b/app/views/documents/_document.html.erb index 08571c5cf..47e894aeb 100644 --- a/app/views/documents/_document.html.erb +++ b/app/views/documents/_document.html.erb @@ -12,7 +12,7 @@ class: 'button hollow' %> - <% if can? :destroy, Document %> + <% if can?(:destroy, document) %> <%= link_to t('documents.buttons.destroy_document'), document_path(document, from: request.url), method: :delete, data: { confirm: t('documents.actions.destroy.confirm') },