CAllCrmActivity::CheckItemUpdatePermission

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmActivity
  4. CheckItemUpdatePermission
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_activity.php
  • Класс: \CAllCrmActivity
  • Вызов: CAllCrmActivity::CheckItemUpdatePermission
static function CheckItemUpdatePermission(array $fields, $userPermissions = null)
{
	$ID = isset($fields['ID']) ? (int)$fields['ID'] : 0;
	if($ID <=  0)
	{
		return false;
	}

	$bindings = self::GetBindings($ID);
	if(is_array($bindings) && !empty($bindings))
	{
		foreach($bindings as &$binding)
		{
			if(self::CheckUpdatePermission($binding['OWNER_TYPE_ID'], $binding['OWNER_ID'], $userPermissions))
			{
				return true;
			}
		}
		unset($binding);
		return false;
	}

	$ownerTypeID = isset($fields['OWNER_TYPE_ID']) ? (int)$fields['OWNER_TYPE_ID'] : CCrmOwnerType::Undefined;
	$ownerID = isset($fields['OWNER_ID']) ? (int)$fields['OWNER_ID'] : 0;

	return $ownerID > 0
		&& CCrmOwnerType::IsDefined($ownerTypeID)
		&& self::CheckUpdatePermission($ownerTypeID, $ownerID, $userPermissions);
}

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