From 45408e45afd36dc91f92c2226d0b773ef409aaa7 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 26 Jan 2015 15:51:34 +0100 Subject: [PATCH] Relax database permission checks in the setup wizard The wizard considered all permissions being exclusively associated to their most important context, which is, in the most common case, incorrect. Permissions assigned on database level do not need to be assigned on table level as well. refs #8267 --- modules/setup/library/Setup/Utils/DbTool.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/setup/library/Setup/Utils/DbTool.php b/modules/setup/library/Setup/Utils/DbTool.php index a368bfa1a..63184acd0 100644 --- a/modules/setup/library/Setup/Utils/DbTool.php +++ b/modules/setup/library/Setup/Utils/DbTool.php @@ -641,7 +641,8 @@ EOD; foreach ($mysqlPrivileges as $privilege) { if (false === empty($context) && $this->mysqlGrantContexts[$privilege] & static::TABLE_LEVEL) { $tablePrivileges[] = $privilege; - } elseif ($this->mysqlGrantContexts[$privilege] & static::DATABASE_LEVEL) { + } + if ($this->mysqlGrantContexts[$privilege] & static::DATABASE_LEVEL) { $dbPrivileges[] = $privilege; } } @@ -661,7 +662,11 @@ EOD; } $tablePrivilegesGranted = true; - if (false === empty($tablePrivileges)) { + if ( + false === empty($tablePrivileges) && ( + !$dbPrivilegesGranted || array_intersect($dbPrivileges, $tablePrivileges) != $tablePrivileges + ) + ) { $tableCondition = 'table_name IN (' . join(',', array_map(array($this, 'quote'), $context)) . ')'; $query = $this->query( 'SELECT COUNT(*) as matches'