Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sectiontrait.php
1<?php
2
4
9
10trait SectionTrait
11{
12 private function isOwner(SectionModel $section, int $userId): bool
13 {
14 return
15 $section->getType() === Event\Tools\Dictionary::CALENDAR_TYPE['user']
16 && $section->getOwnerId() === $userId
17 ;
18 }
19
20 private function isManager(SectionModel $section, int $userId): bool
21 {
22 $settings = \CCalendar::GetSettings(array('request' => false));
23
24 return
25 Loader::includeModule('intranet')
26 && $section->getType() === Event\Tools\Dictionary::CALENDAR_TYPE['user']
27 && ($settings['dep_manager_sub'] ?? false)
28 && Util::isManagerForUser($userId, $section->getOwnerId())
29 ;
30 }
31}
static isManagerForUser($managerId, $userId)
Definition util.php:34