From bf4b6f8faac6ef05af73d7957d650927d301a0da Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Tue, 26 Aug 2014 16:30:38 +0530 Subject: [PATCH] CRM-15176 --- CRM/Admin/Form/Tag.php | 3 +++ CRM/Group/Form/Edit.php | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CRM/Admin/Form/Tag.php b/CRM/Admin/Form/Tag.php index 5346a4d6c9..ccf752700c 100644 --- a/CRM/Admin/Form/Tag.php +++ b/CRM/Admin/Form/Tag.php @@ -54,6 +54,9 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form { $url = CRM_Utils_System::url('civicrm/admin/tag', "reset=1"); CRM_Core_Error::statusBounce(ts("This tag cannot be deleted. You must delete all its child tags ('%1', etc) prior to deleting this tag.", array(1 => $tag)), $url); } + if ($this->_values['is_reserved'] == 1 && !CRM_Core_Permission::check('administer reserved tags')) { + CRM_Core_Error::statusBounce(ts("You do not have sufficient permission to delete this reserved tag.")); + } } else { $this->_isTagSet = CRM_Utils_Request::retrieve('tagset', 'Positive', $this); diff --git a/CRM/Group/Form/Edit.php b/CRM/Group/Form/Edit.php index a7f1cf8ef2..031ca8b744 100644 --- a/CRM/Group/Form/Edit.php +++ b/CRM/Group/Form/Edit.php @@ -111,8 +111,14 @@ class CRM_Group_Form_Edit extends CRM_Core_Form { $this->assign('count', CRM_Contact_BAO_Group::memberCount($this->_id)); CRM_Utils_System::setTitle(ts('Confirm Group Delete')); } + if ($this->_groupValues['is_reserved'] == 1 && !CRM_Core_Permission::check('administer reserved groups')) { + CRM_Core_Error::statusBounce(ts("You do not have sufficient permission to delete this reserved group.")); + } } else { + if ($this->_groupValues['is_reserved'] == 1 && !CRM_Core_Permission::check('administer reserved groups')) { + CRM_Core_Error::statusBounce(ts("You do not have sufficient permission to change settings for this reserved group.")); + } if (isset($this->_id)) { $groupValues = array( 'id' => $this->_id, -- 2.25.1