1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +02:00

Add support for "where" field privilege

In Elasticsearch, only indexed fields are searchable.
This commit is contained in:
Peter Knut
2021-04-05 00:08:42 +02:00
committed by Jakub Vrana
parent 862e5b4aa4
commit 87d87248c1
13 changed files with 18 additions and 16 deletions

View File

@@ -181,6 +181,7 @@ if (isset($_GET["mongo"])) {
"insert" => 1,
"select" => 1,
"update" => 1,
"where" => 1,
),
);
}

View File

@@ -380,7 +380,7 @@ WHERE c.object_id = " . q($table_id)) as $row
"null" => $row["is_nullable"],
"auto_increment" => $row["is_identity"],
"collation" => $row["collation_name"],
"privileges" => array("insert" => 1, "select" => 1, "update" => 1),
"privileges" => array("insert" => 1, "select" => 1, "update" => 1, "where" => 1),
"primary" => $row["is_primary_key"],
"comment" => $comments[$row["name"]],
);

View File

@@ -613,7 +613,7 @@ if (!defined('Adminer\DRIVER')) {
"auto_increment" => ($extra == "auto_increment"),
"on_update" => (preg_match('~\bon update (\w+)~i', $extra, $match) ? $match[1] : ""), //! available since MySQL 5.1.23
"collation" => $row["COLLATION_NAME"],
"privileges" => array_flip(explode(",", $row["PRIVILEGES"])),
"privileges" => array_flip(explode(",", "$row[PRIVILEGES],where")),
"comment" => $row["COLUMN_COMMENT"],
"primary" => ($row["COLUMN_KEY"] == "PRI"),
"generated" => ($generated[1] == "PERSISTENT" ? "STORED" : $generated[1]),

View File

@@ -334,7 +334,7 @@ ORDER BY 1") as $row
"null" => ($row["NULLABLE"] == "Y"),
//! "auto_increment" => false,
//! "collation" => $row["CHARACTER_SET_NAME"],
"privileges" => array("insert" => 1, "select" => 1, "update" => 1),
"privileges" => array("insert" => 1, "select" => 1, "update" => 1, "where" => 1),
//! "comment" => $row["Comment"],
//! "primary" => ($row["Key"] == "PRI"),
);

View File

@@ -266,7 +266,7 @@ if (isset($_GET["sqlite"])) {
"full_type" => $type,
"default" => (preg_match("~^'(.*)'$~", $default, $match) ? str_replace("''", "'", $match[1]) : ($default == "NULL" ? null : $default)),
"null" => !$row["notnull"],
"privileges" => array("select" => 1, "insert" => 1, "update" => 1),
"privileges" => array("select" => 1, "insert" => 1, "update" => 1, "where" => 1),
"primary" => $row["pk"],
);
if ($row["pk"]) {