From: Coleman Watts Date: Thu, 4 Mar 2021 21:53:21 +0000 (-0500) Subject: Export UI - Only present "save mapping" button to permissioned users X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e99512cf450461e5eba7f7d8809f6063632780ac;p=civicrm-core.git 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. --- 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) {