From 9d92564428ce2f7719754ddb70c42bf5d224a00e Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 25 Sep 2024 15:18:38 +0000 Subject: [PATCH] Bug 38010: Add permissions to action buttons --- .../components/Vendors/VendorContracts.vue | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContracts.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContracts.vue index 43adfba7cca..9ad2e0c709f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContracts.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContracts.vue @@ -78,24 +78,30 @@ export default { searchable: false, orderable: false, }, - { - title: __("Actions"), - data: "contractnumber", - searchable: false, - orderable: false, - render: function (data, type, row, meta) { - return ( - `` + - " " + - __("Edit") + - "" + - `` + - " " + - __("Delete") + - "" - ) - }, - }, + ...(isUserPermitted( + "CAN_user_acquisition_contracts_manage" + ) + ? [ + { + title: __("Actions"), + data: "contractnumber", + searchable: false, + orderable: false, + render: function (data, type, row, meta) { + return ( + `` + + " " + + __("Edit") + + "" + + `` + + " " + + __("Delete") + + "" + ) + }, + }, + ] + : []), ], }) ) -- 2.39.3 (Apple Git-146)