Put a permission restriction on loading page without manage groups permission when saved search id is specified in the URL
$this->_componentMode = CRM_Utils_Request::retrieve('component_mode', 'Positive', $this, FALSE, CRM_Contact_BAO_Query::MODE_CONTACTS, $_REQUEST);
$this->_operator = CRM_Utils_Request::retrieve('operator', 'String', $this, FALSE, CRM_Contact_BAO_Query::SEARCH_OPERATOR_AND, 'REQUEST');
+ if (!empty($this->_ssID) && !CRM_Core_Permission::check('edit groups')) {
+ CRM_Core_Error::statusBounce(ts('You do not have permission to modify smart groups'));
+ }
+
/**
* set the button names
*/
*/
public static function corePermissionedTaskTitles($tasks, $permission, $params) {
// Only offer the "Update Smart Group" task if a smart group/saved search is already in play and we have edit permissions
- if (!empty($params['ssID']) && ($permission == CRM_Core_Permission::EDIT)) {
+ if (!empty($params['ssID']) && ($permission == CRM_Core_Permission::EDIT) && CRM_Core_Permission::check('edit groups')) {
$tasks[self::SAVE_SEARCH_UPDATE] = self::$_tasks[self::SAVE_SEARCH_UPDATE]['title'];
}
else {