From bcbb2167777997d3d278e0d62b435308225a2080 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Thu, 2 Jul 2015 14:45:24 +0530 Subject: [PATCH] Event-related profiles can be created & edited with either 'administer CiviCRM' OR 'manage event profiles' permission --- CRM/Core/DAO/permissions.php | 9 +++++++++ CRM/Event/Info.php | 4 ++++ templates/CRM/UF/Page/ProfileTemplates.tpl | 8 +++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CRM/Core/DAO/permissions.php b/CRM/Core/DAO/permissions.php index 7116245f11..d71a45f6bf 100644 --- a/CRM/Core/DAO/permissions.php +++ b/CRM/Core/DAO/permissions.php @@ -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']; diff --git a/CRM/Event/Info.php b/CRM/Event/Info.php index 398e3fc72a..f0e6c33840 100644 --- a/CRM/Event/Info.php +++ b/CRM/Event/Info.php @@ -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) { diff --git a/templates/CRM/UF/Page/ProfileTemplates.tpl b/templates/CRM/UF/Page/ProfileTemplates.tpl index f762e82dff..c1a9796311 100644 --- a/templates/CRM/UF/Page/ProfileTemplates.tpl +++ b/templates/CRM/UF/Page/ProfileTemplates.tpl @@ -115,9 +115,11 @@
- - - + {if call_user_func(array('CRM_Core_Permission', 'check'), 'administer CiviCRM') OR call_user_func(array('CRM_Core_Permission', 'check'), 'manage event profiles')} + + + + {/if}
-- 2.25.1