TaskManager::checkRenewPermission

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. TaskManager
  4. checkRenewPermission
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/taskmanager.php
  • Класс: Bitrix\Crm\Integration\TaskManager
  • Вызов: TaskManager::checkRenewPermission
static function checkRenewPermission($taskID, $userID = 0)
{
	if(!is_int($userID))
	{
		$userID = (int)$userID;
	}

	if($userID <= 0)
	{
		$userID = \CCrmSecurityHelper::GetCurrentUserID();
	}

	if(!is_int($taskID))
	{
		$taskID = (int)$taskID;
	}

	$taskItem = self::getTaskItem($taskID, $userID);
	if($taskItem === null)
	{
		return false;
	}

	try
	{
		if (!class_exists('\Bitrix\Tasks\Access\ActionDictionary'))
		{
			return $taskItem->isActionAllowed(\CTaskItem::ACTION_RENEW);
		}
		return $taskItem->checkAccess(\Bitrix\Tasks\Access\ActionDictionary::ACTION_TASK_RENEW);
	}
	catch(\TasksException $e)
	{
		return false;
	}
}

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