Skip to content

Commit

Permalink
MigrationManager: Also check table privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Sep 15, 2023
1 parent 980de7e commit 0a57b35
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion library/Icinga/Application/MigrationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,16 @@ protected function checkRequiredPrivileges(
$conn = $this->elevateDatabaseConnection($conn, $elevateConfig);
}

$wizardProperties = (new ReflectionClass(WebWizard::class))
->getDefaultProperties();
/** @var array<int, string> $tables */
$tables = $wizardProperties['databaseTables'];

$dbTool = $this->createDbTool($conn);
$dbTool->connectToDb();
if (! $dbTool->checkPrivileges($this->getRequiredDatabasePrivileges())) {
if (! $dbTool->checkPrivileges($this->getRequiredDatabasePrivileges())
&& ! $dbTool->checkPrivileges($this->getRequiredDatabasePrivileges(), $tables)
) {
return false;
}

Expand Down

0 comments on commit 0a57b35

Please sign in to comment.