Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Consumer.php
1<?php
3
4use \Bitrix\Main;
6use \Bitrix\UI\Avatar;
7
9{
10 public const ACCESS_USER = 'U';
11
12 public function getId()
13 {
14 return $this->getUserId();
15 }
16
17 public function getRoles(): array
18 {
19 return $this->getAccessCodes();
20 }
21
22 public function getPermission(string $permissionId, int $userFieldId = 0): ?int
23 {
24 return null;
25 }
26
27 public function getAccessCodes(): array
28 {
29 return array_merge(parent::getAccessCodes(), [
30 'UA', Main\Access\AccessCode::ACCESS_EMPLOYEE . '0', static::ACCESS_USER . $this->getId()]
31 );
32 }
33
34 public function useRecentlyMaskId($id)
35 {
36 Avatar\Model\RecentlyUsedTable::addFromUser($id, $this->getId());
37 }
38}
getPermission(string $permissionId, int $userFieldId=0)
Definition Consumer.php:22