• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/item/subitem.php
  • Класс: BitrixTasksItemSubItem
  • Вызов: SubItem::callCanMethod
protected function callCanMethod($name, $arguments)
{
	// todo: refactor this, because, actually, there should be special Access class for SubItem, which can be switched off manually

	$parent = $this->getParent();
	if($parent === null) // no parent, then we can do everything we want, but this is odd
	{
		return true;
	}

	$transState = $parent->getTransitionState();
	if($transState && $transState->isInProgress())
	{
		// parent is in transition state, everything is allowed
		return true;
	}

	if($name == 'cancreate' || $name == 'canupdate' || $name == 'candelete')
	{
		// ask parent if we can edit it
		return call_user_func_array(array($parent, 'canUpdate'), $arguments);
	}

	return true;
}