CAllCrmLead::CheckConvertPermission

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmLead
  4. CheckConvertPermission
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_lead.php
  • Класс: \CAllCrmLead
  • Вызов: CAllCrmLead::CheckConvertPermission
static function CheckConvertPermission($ID = 0, $entityTypeID = 0, $userPermissions = null)
{
	if(!$userPermissions)
	{
		$userPermissions = CCrmPerms::GetCurrentUserPermissions();
	}

	if($entityTypeID === CCrmOwnerType::Contact)
	{
		return CCrmContact::CheckCreatePermission($userPermissions)
			&& CCrmAuthorizationHelper::CheckUpdatePermission(self::$TYPE_NAME, $ID, $userPermissions);
	}
	elseif($entityTypeID === CCrmOwnerType::Company)
	{
		return CCrmCompany::CheckCreatePermission($userPermissions)
			&& CCrmAuthorizationHelper::CheckUpdatePermission(self::$TYPE_NAME, $ID, $userPermissions);
	}
	elseif($entityTypeID === CCrmOwnerType::Deal)
	{
		return CCrmDeal::CheckCreatePermission($userPermissions)
			&& CCrmAuthorizationHelper::CheckUpdatePermission(self::$TYPE_NAME, $ID, $userPermissions);
	}

	return CCrmAuthorizationHelper::CheckUpdatePermission(self::$TYPE_NAME, $ID, $userPermissions)
		&& (CCrmContact::CheckCreatePermission($userPermissions)
		|| CCrmCompany::CheckCreatePermission($userPermissions)
		|| CCrmDeal::CheckCreatePermission($userPermissions));
}

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