• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/Controller/Category.php
  • Класс: BitrixCrmMobileControllerCategory
  • Вызов: Category::canUpdateCategory
private function canUpdateCategory(Factory $factory, int $categoryId): bool
{
	$isCategoriesEnabled = $factory->isCategoriesEnabled();
	if ($isCategoriesEnabled)
	{
		$category = $this->getCategoryFromFactory($factory, $categoryId);
		if (!$category)
		{
			return false;
		}

		if (!Container::getInstance()->getUserPermissions()->canUpdateCategory($category))
		{
			$this->addError(ErrorCode::getAccessDeniedError());
			return false;
		}
	}
	elseif (!Container::getInstance()->getUserPermissions()->canUpdateType($factory->getEntityTypeId()))
	{
		$this->addError(ErrorCode::getAccessDeniedError());
		return false;
	}

	return true;
}