Merge pull request #18812 from kamyweb/role_based_auth
Add role based auth for MySQL 8.x and compatibles
This commit is contained in:
commit
856d316332
@ -6755,11 +6755,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/DatabaseInterface.php
|
||||
|
||||
-
|
||||
message: "#^Only booleans are allowed in an if condition, PhpMyAdmin\\\\Dbal\\\\ResultInterface\\|false given\\.$#"
|
||||
count: 2
|
||||
path: src/DatabaseInterface.php
|
||||
|
||||
-
|
||||
message: "#^Only booleans are allowed in an if condition, int\\|false given\\.$#"
|
||||
count: 2
|
||||
|
||||
@ -1517,11 +1517,7 @@ class DatabaseInterface implements DbalInterface
|
||||
if (! $hasGrantPrivilege) {
|
||||
foreach ($this->getCurrentRolesAndHost() as [$role, $roleHost]) {
|
||||
$query = QueryGenerator::getInformationSchemaDataForGranteeRequest($role, $roleHost ?? '');
|
||||
$result = $this->tryQuery($query);
|
||||
|
||||
if ($result) {
|
||||
$hasGrantPrivilege = (bool) $result->numRows();
|
||||
}
|
||||
$hasGrantPrivilege = (bool) $this->fetchValue($query);
|
||||
|
||||
if ($hasGrantPrivilege) {
|
||||
break;
|
||||
@ -1568,11 +1564,7 @@ class DatabaseInterface implements DbalInterface
|
||||
if (! $hasCreatePrivilege) {
|
||||
foreach ($this->getCurrentRolesAndHost() as [$role, $roleHost]) {
|
||||
$query = QueryGenerator::getInformationSchemaDataForCreateRequest($role, $roleHost ?? '');
|
||||
$result = $this->tryQuery($query);
|
||||
|
||||
if ($result) {
|
||||
$hasCreatePrivilege = (bool) $result->numRows();
|
||||
}
|
||||
$hasCreatePrivilege = (bool) $this->fetchValue($query);
|
||||
|
||||
if ($hasCreatePrivilege) {
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user