if ($isEvent) {
$this->setComponentID(CRM_Utils_Request::retrieve('compId', 'Integer', $this));
- if (!CRM_Event_BAO_Event::checkPermission($this->getComponentID(), CRM_Core_Permission::EDIT)) {
+ if (!CRM_Event_BAO_Event::checkPermission((int) $this->getComponentID(), CRM_Core_Permission::EDIT)) {
throw new CRM_Core_Exception(ts('You do not have permission to access this page.'));
}
}
* Whether the user has permission for this event (or if eventId=NULL an array of permissions)
* @throws \CiviCRM_API3_Exception
*/
- public static function checkPermission($eventId = NULL, $permissionType = CRM_Core_Permission::VIEW) {
- if (empty($eventId)) {
- CRM_Core_Error::deprecatedFunctionWarning('CRM_Event_BAO_Event::getAllPermissions');
- return self::getAllPermissions();
- }
-
+ public static function checkPermission(int $eventId, $permissionType = CRM_Core_Permission::VIEW) {
switch ($permissionType) {
case CRM_Core_Permission::EDIT:
// We also set the cached "view" permission to TRUE if "edit" is TRUE
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'title');
}
- if (!CRM_Event_BAO_Event::checkPermission($this->_id, CRM_Core_Permission::DELETE)) {
+ if (!CRM_Event_BAO_Event::checkPermission((int) $this->_id, CRM_Core_Permission::DELETE)) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
}