From 4ec4e02411375243a65800b3bd36bd7ee6817cf0 Mon Sep 17 00:00:00 2001 From: eelke Date: Thu, 27 Dec 2018 12:07:19 +0100 Subject: [PATCH] The SQL tab for a table now also shares the grant/revoke statements for that table (but not yet any column level grants). --- pglab/TablesPage.cpp | 1 + pglablib/catalog/PgClass.cpp | 10 ++++++++++ pglablib/catalog/PgClass.h | 1 + 3 files changed, 12 insertions(+) diff --git a/pglab/TablesPage.cpp b/pglab/TablesPage.cpp index 9fe47b7..1e31415 100644 --- a/pglab/TablesPage.cpp +++ b/pglab/TablesPage.cpp @@ -267,6 +267,7 @@ void TablesPage::updateSqlTab(const std::optional &table) // Privileges create_sql += "-- set Privileges\n"; + create_sql += table->grantSql(); // Comments create_sql += "-- set Comments table + columns\n"; diff --git a/pglablib/catalog/PgClass.cpp b/pglablib/catalog/PgClass.cpp index 2415bee..3ae416b 100644 --- a/pglablib/catalog/PgClass.cpp +++ b/pglablib/catalog/PgClass.cpp @@ -88,6 +88,16 @@ QString PgClass::typeName() const throw std::runtime_error("Unexpected value in PgClass::typeName()"); } +QString PgClass::aclAllPattern() const +{ + switch (kind) { + case RelKind::Table: return "arwdDxt"; + default: + break; + } + return {}; +} + QString PgClass::createTableSql() const { QString sql; diff --git a/pglablib/catalog/PgClass.h b/pglablib/catalog/PgClass.h index 8fa9be3..3e67e29 100644 --- a/pglablib/catalog/PgClass.h +++ b/pglablib/catalog/PgClass.h @@ -65,6 +65,7 @@ public: QString createSql() const; QString typeName() const override; + QString aclAllPattern() const override; private: mutable QString createSqlCache;