Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
permissionmanager.php
1
<?php
2
namespace
Bitrix\Calendar\Rooms
;
3
use
Bitrix\Calendar\Integration\Bitrix24Manager
;
4
5
class
PermissionManager
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
}
Bitrix\Calendar\Integration\Bitrix24Manager
Definition
bitrix24manager.php:18
Bitrix\Calendar\Rooms\Manager\TYPE
const TYPE
Definition
manager.php:22
Bitrix\Calendar\Rooms\PermissionManager
Definition
permissionmanager.php:6
Bitrix\Calendar\Rooms\PermissionManager\checkTypePermission
static checkTypePermission($operation)
Definition
permissionmanager.php:13
Bitrix\Calendar\Rooms\PermissionManager\isLocationFeatureEnabled
static isLocationFeatureEnabled()
Definition
permissionmanager.php:47
Bitrix\Calendar\Rooms\PermissionManager\checkSectionPermission
static checkSectionPermission($operation, $sectionId)
Definition
permissionmanager.php:32
Bitrix\Calendar\Rooms\PermissionManager\getAvailableOperations
static getAvailableOperations()
Definition
permissionmanager.php:55
Bitrix\Calendar\Rooms
Definition
accessibilitymanager.php:3
modules
calendar
lib
rooms
permissionmanager.php
Создано системой
1.10.0