• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/controller/userfieldconfig.php
  • Класс: BitrixMainControllerUserFieldConfig
  • Вызов: UserFieldConfig::getTypesAction
public function getTypesAction(string $moduleId, CRestServer $restServer = null): ?array
{
	$access = $this->getAccess($moduleId, $restServer);
	if (!$access)
	{
		return null;
	}

	$result = [];

	$restrictedTypes = array_flip($access->getRestrictedTypes());

	global $USER_FIELD_MANAGER;
	$types = $USER_FIELD_MANAGER->GetUserType();

	if (empty($restrictedTypes))
	{
		return $types;
	}

	foreach ($types as $id => $type)
	{
		if (!isset($restrictedTypes[$id]))
		{
			$result[$id] = [
				'userTypeId' => $type['USER_TYPE_ID'],
				'description' => $type['DESCRIPTION'],
			];
		}
	}

	return [
		'types' => $result,
	];
}