Create export mappings without admin perms
authorJon Goldberg <jon@megaphonetech.com>
Thu, 18 May 2023 19:22:25 +0000 (15:22 -0400)
committerJon Goldberg <jon@megaphonetech.com>
Thu, 18 May 2023 19:22:25 +0000 (15:22 -0400)
CRM/Core/Permission.php
ang/exportui.ang.php
ang/exportui/export.html
ang/exportui/exportui.js

index 2a412f526afd78aa17b0809c939fc2f5dd84ea90..7d8a61c5d8ae988f1270dc809f75973e46c286e0 100644 (file)
@@ -1516,6 +1516,12 @@ class CRM_Core_Permission {
         'access CiviCRM',
       ],
     ];
+    $permissions['mapping'] = [
+      'default' => [
+        'access CiviCRM',
+      ],
+    ];
+    $permissions['mapping_field'] = $permissions['mapping'];
 
     $permissions['saved_search'] = [
       'default' => ['administer CiviCRM data'],
index f340a018f60a02983d0f18fe8ccd25d227681e7a..cb0871ed30735901d4b58beb8aefb4708bc1dfb7 100644 (file)
@@ -13,7 +13,6 @@ return [
     'ang/exportui',
   ],
   'basePages' => [],
-  'permissions' => ['administer CiviCRM'],
   'requires' => [
     'crmUi',
     'crmUtil',
index 2cca22fc9ebbfd329bcf1f6f721c6d1e8d864ba2..8a3e0936194b887d3c75ae89feffce782d252093 100644 (file)
@@ -19,7 +19,7 @@
     <tr>
       <td colspan="6">
         <input class="crm-action-menu fa-plus crm-export-add-field" crm-ui-select="{data: getFields, placeholder: ts('Add field')}" ng-model="new.col" />
-        <span ng-if="data.columns.length && perms.admin">
+        <span ng-if="data.columns.length">
           <button type="button" ng-click="saveMappingDialog()" crm-icon="fa-save">
             {{:: ts('Save Fields') }}
           </button>
index b39b13b6af430feb1adf3adfbf4cc607917ccc90..33651243145d6ec9c70af1889acd817227535d5a 100644 (file)
@@ -24,9 +24,6 @@
         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) {