- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_event.php
- Класс: CCalendarEvent
- Вызов: CCalendarEvent::CanView
static function CanView($eventId, $userId)
{
if ((int)$eventId > 0)
{
Loader::includeModule("calendar");
$event = self::GetList(
array(
'arFilter' => array(
"ID" => $eventId,
),
'parseRecursion' => false,
'fetchAttendees' => true,
'checkPermissions' => true,
'userId' => $userId,
)
);
if (!$event || !is_array($event[0]))
{
$event = self::GetList(
array(
'arFilter' => array(
"PARENT_ID" => $eventId,
"CREATED_BY" => $userId
),
'parseRecursion' => false,
'fetchAttendees' => true,
'checkPermissions' => true,
'userId' => $userId,
)
);
}
// Event is not partly accessible - so it was not cleaned before by ApplyAccessRestrictions
if (
$event
&& is_array($event[0])
&& ($event[0]['IS_ACCESSIBLE_TO_USER'] ?? null) !== false
&& (
isset($event[0]['DESCRIPTION'])
|| isset($event[0]['IS_MEETING'])
|| isset($event[0]['LOCATION'])
)
)
{
return true;
}
}
return false;
}