• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/Access/Service/RolePermissionService.php
  • Класс: BitrixCatalogAccessServiceRolePermissionService
  • Вызов: RolePermissionService::deleteRole
public function deleteRole(int $roleId): void
{
	$db = Application::getConnection();

	try
	{
		$db->startTransaction();

		PermissionTable::deleteList(["=ROLE_ID" => $roleId]);

		$this->roleRelationService->deleteRoleRelations($roleId);

		/**
		 * @var BitrixMainORMDataDeleteResult
		 */
		$result = RoleTable::delete($roleId);
		if (!$result->isSuccess())
		{
			throw new SqlQueryException(self::DB_ERROR_KEY);
		}

		$db->commitTransaction();
	}
	catch (Throwable $e)
	{
		$db->rollbackTransaction();

		throw $e;
	}
}