CAllCrmDeal::CheckUpdatePermission

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmDeal
  4. CheckUpdatePermission
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_deal.php
  • Класс: \CAllCrmDeal
  • Вызов: CAllCrmDeal::CheckUpdatePermission
static function CheckUpdatePermission($ID, $userPermissions = null, $categoryID = -1, array $options = null)
{
	if($categoryID < 0 && $ID > 0)
	{
		$categoryID = self::GetCategoryID($ID);
	}

	if($categoryID >= 0)
	{
		$categoryIDs = array($categoryID);
	}
	else
	{
		$categoryIDs = DealCategory::getAllIDs();
		if($ID > 0)
		{
			$ID = 0;
		}
	}

	$entityAttrs = $ID > 0 && is_array($options) && isset($options['ENTITY_ATTRS']) ? $options['ENTITY_ATTRS'] : null;
	foreach($categoryIDs as $curCategoryID)
	{
		$permissionEntity = DealCategory::convertToPermissionEntityType($curCategoryID);
		if(CCrmAuthorizationHelper::CheckUpdatePermission($permissionEntity, $ID, $userPermissions, $entityAttrs))
		{
			return true;
		}
	}
	return false;
}

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