Event-related profiles can be created & edited with either 'administer CiviCRM' OR...
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 2 Jul 2015 09:15:24 +0000 (14:45 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 2 Jul 2015 09:15:24 +0000 (14:45 +0530)
CRM/Core/DAO/permissions.php
CRM/Event/Info.php
templates/CRM/UF/Page/ProfileTemplates.tpl

index 7116245f11eb4a969540bb2f33d633e45aabed8d..d71a45f6bf6efef349d783e91f0f95f8aa2ddbbc 100644 (file)
@@ -466,11 +466,20 @@ function _civicrm_api3_permissions($entity, $action, &$params) {
   );
 
   $permissions['uf_group'] = array(
+    'create' => array(
+      'access CiviCRM',
+      'manage event profiles',
+    ),
     'get' => array(
       'access CiviCRM',
     ),
+    'update' => array(
+      'access CiviCRM',
+      'manage event profiles',
+    ),
   );
   $permissions['uf_field'] = $permissions['uf_group'];
+  $permissions['uf_field']['delete'] = array('access CiviCRM', 'manage event profiles');
   $permissions['option_value'] = $permissions['uf_group'];
   $permissions['option_group'] = $permissions['option_value'];
 
index 398e3fc72ad08db98e5cc3a7ad159dcb7de923a6..f0e6c33840212b5f38595c835702deb10130620f 100644 (file)
@@ -93,6 +93,10 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
         ts('delete in CiviEvent'),
         ts('Delete participants and events that you can edit'),
       ),
+      'manage event profiles' => array(
+        ts('manage event profiles'),
+        ts('Allow users to create, edit and copy event-related profile forms used for online event registration.'),
+      ),
     );
 
     if (!$descriptions) {
index f762e82dffe55b7937f604da90bab7e950178938..c1a9796311703beec967320ee722b2f278cbcda3 100644 (file)
     <div>
         <span class="crm-profile-selector-select"></span>
         <button type="button" class="crm-profile-selector-preview" title="{ts}Preview{/ts}"><div class="icon ui-icon-zoomin">{ts}Preview{/ts}</div></button>
-        <button class="crm-profile-selector-edit">{ts}Edit{/ts}</button>
-        <button class="crm-profile-selector-copy">{ts}Copy{/ts}</button>
-        <button class="crm-profile-selector-create">{ts}Create{/ts}</button>
+        {if call_user_func(array('CRM_Core_Permission', 'check'), 'administer CiviCRM') OR call_user_func(array('CRM_Core_Permission', 'check'), 'manage event profiles')}
+          <button class="crm-profile-selector-edit">{ts}Edit{/ts}</button>
+          <button class="crm-profile-selector-copy">{ts}Copy{/ts}</button>
+          <button class="crm-profile-selector-create">{ts}Create{/ts}</button>
+        {/if}
     </div>
     <form>
     <div class="crm-profile-selector-preview-pane">