CAllCrmQuote::BuildPermSql

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmQuote
  4. BuildPermSql
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_quote.php
  • Класс: \CAllCrmQuote
  • Вызов: CAllCrmQuote::BuildPermSql
public function BuildPermSql($sAliasPrefix = self::TABLE_ALIAS, $mPermType = 'READ', $arOptions = [])
{
	$userId = null;
	if (isset($arOptions['PERMS']) && is_object($arOptions['PERMS']))
	{
		/** @var \CCrmPerms $arOptions['PERMS'] */
		$userId = $arOptions['PERMS']->GetUserID();
	}
	$builderOptions =
		Crm\Security\QueryBuilder\Options::createFromArray((array)$arOptions)
			->setOperations((array)$mPermType)
			->setAliasPrefix((string)$sAliasPrefix)
	;

	$queryBuilder = Crm\Service\Container::getInstance()
		->getUserPermissions($userId)
		->createListQueryBuilder(self::$TYPE_NAME, $builderOptions)
	;

	return $queryBuilder->buildCompatible();
}

Добавить комментарий