From b68563f45f7811dd04d6ee984fd30344d9c0ca42 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 30 May 2018 17:53:32 +0200 Subject: [PATCH] Only dossier owner can see delete button --- ...panel_users_recapitulatifcontroller_show.html.haml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml index ba9803d9b..1e5a3a253 100644 --- a/app/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml +++ b/app/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml @@ -14,8 +14,9 @@ .dossier-state= @facade.dossier.display_state .split-hr-left - .text-center.mt-1 - = link_to ask_deletion_dossier_path(@facade.dossier), method: :post, class: "btn btn-danger", data: { confirm: delete_dossier_confirm(@facade.dossier) } do - Supprimer définitivement - %br - ce dossier + - if @facade.dossier.user == current_user + .text-center.mt-1 + = link_to ask_deletion_dossier_path(@facade.dossier), method: :post, class: "btn btn-danger", data: { confirm: delete_dossier_confirm(@facade.dossier) } do + Supprimer définitivement + %br + ce dossier