1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
EventController.php
См. документацию.
1<?php
2
4
10
12{
13 public function __construct(array $options)
14 {
15 $options['eventId'] = (int)($options['eventId'] ?? 0);
16
17 parent::__construct($options);
18 }
19
20 public function isAvailable(): bool
21 {
22 return $this->hasRights(ActionDictionary::ACTION_EVENT_VIEW_FULL);
23 }
24
26 {
27 return new Configuration();
28 }
29
30 public function canUpload()
31 {
32 return $this->hasRights(ActionDictionary::ACTION_EVENT_EDIT);
33 }
34
35 public function canView(): bool
36 {
37 return $this->hasRights(ActionDictionary::ACTION_EVENT_VIEW_FULL);
38 }
39
41 {
42 }
43
44 public function canRemove(): bool
45 {
46 return $this->hasRights(ActionDictionary::ACTION_EVENT_EDIT);
47 }
48
49 private function hasRights(string $action): bool
50 {
51 $eventId = $this->getOption('eventId', 0);
52
53 if (empty($eventId))
54 {
55 return true;
56 }
57
58 $userId = \CCalendar::getCurUserId();
59 $eventModel = \CCalendarEvent::getEventModelForPermissionCheck(
60 eventId: $eventId,
61 userId: $userId
62 );
63
64 return (new EventAccessController($userId))->check($action, $eventModel);
65 }
66}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
verifyFileOwner(FileOwnershipCollection $files)
Определения EventController.php:40
getOption(string $option, $defaultValue=null)
Определения UploaderController.php:58
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$files
Определения mysql_to_pgsql.php:30
$action
Определения file_dialog.php:21