9namespace Bitrix\Main\Access\User;
11use Bitrix\HumanResources\Config\Storage;
12use Bitrix\HumanResources\Service\Container;
13use Bitrix\Main\Access\AccessCode;
14use Bitrix\Main\Engine\CurrentUser;
15use Bitrix\Main\Loader;
16use Bitrix\Main\UserAccessTable;
17use Bitrix\Main\UserTable;
35 if (!array_key_exists(
$key, static::$cache))
37 $model =
new static();
39 static::$cache[
$key] = $model;
41 return static::$cache[
$key];
61 if ($this->name ===
null)
63 if ($this->userId === 0)
75 if ($this->userDepartments ===
null)
91 $currentUser = CurrentUser::get();
92 if ((
int) $currentUser->getId() === $this->userId)
94 $userGroups = $currentUser->getUserGroups();
98 $userGroups = \CUser::GetUserGroup($this->userId);
100 $this->
isAdmin = in_array(1, $userGroups);
108 if ($this->accessCodes ===
null)
110 $this->accessCodes = [];
111 if ($this->userId === 0)
117 $res = UserAccessTable::query()
118 ->setSelect([
'ACCESS_CODE'])
119 ->where(
'USER_ID', $this->userId)
120 ->whereNot(
'PROVIDER_ID',
'imchat')
124 foreach (
$res as $row)
126 $signature = (
new AccessCode($row[
'ACCESS_CODE']))->getSignature();
129 $this->accessCodes[$signature] = $signature;
133 $this->accessCodes = array_values($this->accessCodes);
137 && Storage::instance()->isCompanyStructureConverted()
150 'select' => [
'UF_DEPARTMENT'],
152 '=ID' => $this->userId,
159 && is_array(
$user[
'UF_DEPARTMENT'])
161 && !empty(array_values(
$user[
'UF_DEPARTMENT'])[0])
static createFromId(int $userId)
getPermission(string $permissionId)
getSubordinate(int $userId)
static getDepartmentsByUserId(int $userId)
static includeModule($moduleName)
static isModuleInstalled($moduleName)
static getList(array $parameters=array())
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"