1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
permissions.php
См. документацию.
1<?php
2
4
6use Bitrix\Crm\Service\Container;
7
9{
10 private static ?Permissions $instance = null;
11 private bool $isCrmInstalled;
12
13 public static function getInstance(): self
14 {
15 if (!isset(self::$instance))
16 {
17 self::$instance = new self;
18 }
19
20 return self::$instance;
21 }
22
23 public function hasAccessToCrm(): bool
24 {
25 return $this->isCrmInstalled && Container::getInstance()->getUserPermissions()->entityType()->canReadSomeItemsInCrm();
26 }
27
28 private function __construct()
29 {
30 $this->isCrmInstalled = Loader::includeModule('crm');
31 }
32}
Определения loader.php:13