MigrationManager: Also check table privileges

This commit is contained in:
Johannes Meyer 2023-09-15 17:18:14 +02:00
parent 4a8d171aec
commit 9c6d930e17
1 changed files with 8 additions and 1 deletions

View File

@ -327,9 +327,16 @@ final class MigrationManager implements Countable
$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;
}