• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/access/role/roleutil.php
  • Класс: BitrixMainAccessRoleRoleUtil
  • Вызов: RoleUtil::updateTitle
public function updateTitle(string $title)
{
	$this->loadRole();

	if ($this->role->getName() === $title)
	{
		return;
	}

	$dictionaryClass = static::getRoleDictionaryClass();
	if (
		$dictionaryClass
		&& $dictionaryClass::getRoleName($this->role->getName()) === $title
	)
	{
		return;
	}

	$this->role->setName($title);
	$result = $this->role->save();

	if (!$result->isSuccess())
	{
		throw new RoleNotFoundException();
	}
}