• Модуль: rpa
  • Путь к файлу: ~/bitrix/modules/rpa/lib/userpermissions.php
  • Класс: BitrixRpaUserPermissions
  • Вызов: UserPermissions::getViewableStageIds
protected function getViewableStageIds(Type $type): array
{
	if(static::canViewOnAnyStage())
	{
		return $type->getStages()->getIdList();
	}

	$firstStageId = null;
	$firstStage = $type->getFirstStage();
	if($firstStage)
	{
		$firstStageId = $firstStage->getId();
	}
	$viewableStageIds = [];
	foreach($this->permissions as $entity => $permission)
	{
		if(preg_match('/^'.static::ENTITY_STAGE.'(d+)$/', $entity, $matches))
		{
			$matches[1] = (int) $matches[1];
			if($matches[1] !== $firstStageId)
			{
				$viewableStageIds[] = $matches[1];
			}
		}
	}

	if(empty($viewableStageIds))
	{
		$viewableStageIds[] = '!@#$%';
	}

	return $viewableStageIds;
}