From 642de2f65f7b1ff50386d61353020aa3a24911e0 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 14 Jan 2015 12:16:49 +1100 Subject: [PATCH] Only show delete enterprise link when user has permission --- app/views/admin/enterprises/_actions.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/admin/enterprises/_actions.html.haml b/app/views/admin/enterprises/_actions.html.haml index 69dd6569a8..c41cf290bc 100644 --- a/app/views/admin/enterprises/_actions.html.haml +++ b/app/views/admin/enterprises/_actions.html.haml @@ -1,8 +1,9 @@ = link_to_with_icon('icon-edit', 'Edit Profile', main_app.edit_admin_enterprise_path(enterprise), class: 'edit') %br/ -= link_to_delete_enterprise enterprise -%br/ +- if can? :destroy, enterprise + = link_to_delete_enterprise enterprise + %br/ - if enterprise.is_primary_producer = link_to_with_icon 'icon-dashboard', 'Properties', main_app.admin_enterprise_producer_properties_path(enterprise_id: enterprise.id)