1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
EventCategoryAccess.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\EventCategory;
4
5use Bitrix\Calendar\Access\ActionDictionary;
6use Bitrix\Calendar\Access\EventCategoryAccessController;
7use Bitrix\Calendar\Access\Model\EventCategoryModel;
8use Bitrix\Calendar\Core\EventCategory\EventCategory;
9use Bitrix\Calendar\EventCategory\Dto\EventCategoryPermissions;
10use Bitrix\Calendar\OpenEvents\Internals\Entity\OpenEventCategory;
11
13{
15 {
16 return self::getPermissions(EventCategoryModel::createFromObject($category), $userId);
17 }
18
20 {
21 return self::getPermissions(EventCategoryModel::createFromEntity($category), $userId);
22 }
23
24 private static function getPermissions(EventCategoryModel $model, int $userId): EventCategoryPermissions
25 {
26 $eventCategoryAccessController = new EventCategoryAccessController($userId);
27 $accessResult = $eventCategoryAccessController->batchCheck(
28 [
29 ActionDictionary::ACTION_EVENT_CATEGORY_EDIT => [],
30// ActionDictionary::ACTION_EVENT_CATEGORY_DELETE => [],
31 ],
32 $model,
33 );
34
35 return new EventCategoryPermissions(
36 edit: $accessResult[ActionDictionary::ACTION_EVENT_CATEGORY_EDIT],
37 delete: false,
38 );
39 }
40}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static getPermissionsForEntity(OpenEventCategory $category, int $userId)
Определения EventCategoryAccess.php:19
static getPermissionsForObject(EventCategory $category, int $userId)
Определения EventCategoryAccess.php:14