Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
permissionmanager.php
1<?php
4
6{
13 public static function checkTypePermission($operation): bool
14 {
15 $userId = \CCalendar::GetUserId();
16
17 if(!\CCalendarType::CanDo($operation, Manager::TYPE, $userId))
18 {
19 return false;
20 }
21
22 return true;
23 }
24
32 public static function checkSectionPermission($operation, $sectionId): bool
33 {
34 $userId = \CCalendar::GetUserId();
35
36 if(!\CCalendarSect::CanDo($operation, $sectionId, $userId))
37 {
38 return false;
39 }
40
41 return true;
42 }
43
47 public static function isLocationFeatureEnabled(): bool
48 {
49 return Bitrix24Manager::isFeatureEnabled('calendar_location');
50 }
51
55 public static function getAvailableOperations(): ?array
56 {
57 $result = \CCalendarType::GetList([
58 'arFilter' => [
59 'XML_ID' => 'location',
60 ],
61 ]);
62
63 return $result[0]['PERM'] ?? null;
64 }
65}
static checkSectionPermission($operation, $sectionId)