- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_event.php
- Класс: CCalendarEvent
- Вызов: CCalendarEvent::getEventPermissions
static function getEventPermissions(array $event, int $userId = 0)
{
if ($userId <= 0)
{
$userId = CCalendar::GetUserId();
}
$accessController = new EventAccessController($userId);
$eventModel = self::getEventModelForPermissionCheck((int)($event['ID'] ?? 0), $event, $userId);
$request = [
ActionDictionary::ACTION_EVENT_VIEW_FULL => [],
ActionDictionary::ACTION_EVENT_VIEW_TIME => [],
ActionDictionary::ACTION_EVENT_VIEW_TITLE => [],
ActionDictionary::ACTION_EVENT_VIEW_COMMENTS => [],
ActionDictionary::ACTION_EVENT_EDIT => [],
];
$accessResult = $accessController->batchCheck($request, $eventModel);
return [
'view_full' => $accessResult[ActionDictionary::ACTION_EVENT_VIEW_FULL],
'view_time' => $accessResult[ActionDictionary::ACTION_EVENT_VIEW_TIME],
'view_title' => $accessResult[ActionDictionary::ACTION_EVENT_VIEW_TITLE],
'view_comments' => $accessResult[ActionDictionary::ACTION_EVENT_VIEW_COMMENTS],
'edit' => $accessResult[ActionDictionary::ACTION_EVENT_EDIT],
];
}