- //CRM-16777: Don't provide access to administer schedule reminder page, with user that does not have 'administer CiviCRM' permission
- if (empty($this->_context) && !CRM_Core_Permission::check('administer CiviCRM')) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
- }
- //CRM-16777: When user have ACLs 'edit' permission for specific event, do not give access to add, delete & updtae
- //schedule reminder for other events.
- else {
- $this->_compId = CRM_Utils_Request::retrieve('compId', 'Integer', $this);
- if (!CRM_Event_BAO_Event::checkPermission($this->_compId, CRM_Core_Permission::EDIT)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+ if ($isEvent) {
+ $this->setComponentID(CRM_Utils_Request::retrieve('compId', 'Integer', $this));
+ if (!CRM_Event_BAO_Event::checkPermission($this->getComponentID(), CRM_Core_Permission::EDIT)) {
+ throw new CRM_Core_Exception(ts('You do not have permission to access this page.'));