N°8782 - Union queries allow all data (#807)

* 8782 - Union queries allow all data

* N°8782 - Union queries allow all data
This commit is contained in:
Eric Espié
2026-02-23 15:10:09 +01:00
committed by GitHub
parent 454a1b26eb
commit 48e584503e
2 changed files with 11 additions and 1 deletions

View File

@@ -59,7 +59,7 @@ class DBUnionSearch extends DBSearch
public function AllowAllData($bAllowAllData = true)
{
foreach ($this->aSearches as $oSearch) {
$oSearch->AllowAllData();
$oSearch->AllowAllData($bAllowAllData);
}
}

View File

@@ -183,4 +183,14 @@ class DBUnionSearchTest extends ItopDataTestCase
],
];
}
public function testAllowAllDataOnUnions()
{
$oSearch = \DBObjectSearch::FromOQL('SELECT Server UNION SELECT VirtualMachine');
$oSearch->AllowAllData(false);
self::assertFalse($oSearch->IsAllDataAllowed(), 'DBUnionSearch AllowData value');
$oSearch->AllowAllData(true);
self::assertTrue($oSearch->IsAllDataAllowed(), 'DBUnionSearch AllowData value');
}
}