• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/security/controller/base.php
  • Класс: Bitrix\Crm\Security\Controller\Base
  • Вызов: Base::getPermissionAttributes
public function getPermissionAttributes(string $permissionEntityType, array $entityIDs): array
{
	$entityTypeId = $this->getEntityTypeId();
	if (!isset($this->cachedAttrs[$entityTypeId]))
	{
		$this->cachedAttrs[$entityTypeId] = [];
	}

	$entityIDs = array_unique(array_filter(array_map('intval', $entityIDs)));
	if (empty($entityIDs))
	{
		return [];
	}

	$result = [];
	$notCachedIds = [];
	foreach ($entityIDs as $entityId)
	{
		if (!array_key_exists($entityId, $this->cachedAttrs[$entityTypeId]))
		{
			$notCachedIds[] = $entityId;
		}
	}
	if (!empty($notCachedIds))
	{
		foreach ($this->loadPermissionAttributes($notCachedIds) as $loadedEntityId => $loadedEntityAttrs)
		{
			$this->cachedAttrs[$entityTypeId][$loadedEntityId] = $loadedEntityAttrs;
		}
	}
	foreach ($entityIDs as $entityId)
	{
		if (!empty($this->cachedAttrs[$entityTypeId][$entityId]))
		{
			$result[$entityId] = $this->cachedAttrs[$entityTypeId][$entityId];
		}
	}

	return $result;
}