From e99512cf450461e5eba7f7d8809f6063632780ac Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 4 Mar 2021 16:53:21 -0500 Subject: [PATCH] Export UI - Only present "save mapping" button to permissioned users The button was showing for all users which would result in confusion when it didn't work because they lacked permission. Currently the APIv3 Mapping.create api requires "administer CiviCRM." I don't know if that's right or if there's another permission it ought to be checking, but at least this brings the UI in alignment with what's currently allowed. --- ang/exportui.ang.php | 1 + ang/exportui/export.html | 2 +- ang/exportui/exportui.js | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ang/exportui.ang.php b/ang/exportui.ang.php index cb0871ed30..f340a018f6 100644 --- a/ang/exportui.ang.php +++ b/ang/exportui.ang.php @@ -13,6 +13,7 @@ return [ 'ang/exportui', ], 'basePages' => [], + 'permissions' => ['administer CiviCRM'], 'requires' => [ 'crmUi', 'crmUtil', diff --git a/ang/exportui/export.html b/ang/exportui/export.html index 8a3e093619..2cca22fc9e 100644 --- a/ang/exportui/export.html +++ b/ang/exportui/export.html @@ -19,7 +19,7 @@ - + diff --git a/ang/exportui/exportui.js b/ang/exportui/exportui.js index 88bb01a268..91a8ee5e73 100644 --- a/ang/exportui/exportui.js +++ b/ang/exportui/exportui.js @@ -22,6 +22,9 @@ contact_type: '', columns: [] }; + $scope.perms = { + admin: CRM.checkPerm('administer CiviCRM') + }; // For the "add new field" dropdown $scope.new = {col: ''}; var contactTypes = _.transform($scope.contact_types, function(result, type) { -- 2.25.1