Revert "PG16 support privilege MAINTAIN"

This reverts commit bcb87cf9e41c87efdcbeb7c80389d9fee35d29b8.
This commit is contained in:
lsv 2023-09-27 09:47:09 +05:00 committed by lsv
parent fc71d91348
commit 0f241fef7c
8 changed files with 11 additions and 27 deletions

View file

@ -26,7 +26,7 @@
#include <wx/arrimpl.cpp>
defaultPrivilegesOn g_defPrivTables('r', wxT("Tables"), wxT("arwdDxtm")),
defaultPrivilegesOn g_defPrivTables('r', wxT("Tables"), wxT("arwdDxt")),
g_defPrivSequences('S', wxT("Sequences"), wxT("rwU")),
g_defPrivFunctions('f', wxT("Functions"), wxT("X")),
g_defPrivTypes('T', wxT("Types"), wxT("U"));

View file

@ -188,7 +188,7 @@ dlgProperty *pgPartitionFactory::CreateDialog(frmMain *frame, pgObject *node, pg
}
dlgTable::dlgTable(pgaFactory *f, frmMain *frame, pgTable *node, pgSchema *sch)
: dlgSecurityProperty(f, frame, node, wxT("dlgTable"), wxT("INSERT,SELECT,UPDATE,DELETE,TRUNCATE,RULE,REFERENCES,TRIGGER,MAINTAIN"), "arwdDRxtm")
: dlgSecurityProperty(f, frame, node, wxT("dlgTable"), wxT("INSERT,SELECT,UPDATE,DELETE,TRUNCATE,RULE,REFERENCES,TRIGGER"), "arwdDRxt")
{
schema = sch;
table = node;
@ -1508,9 +1508,7 @@ wxString dlgTable::GetSql()
if (seclabelPage && connection->BackendMinimumVersion(9, 1))
sql += seclabelPage->GetSqlForSecLabels(wxT("TABLE"), qtIdent(cbSchema->GetValue()) + wxT(".") + qtIdent(GetName()));
if (connection->BackendMinimumVersion(16, 0))
sql += GetGrant(wxT("arwdDxtm"), wxT("TABLE ") + tabname);
else if (connection->BackendMinimumVersion(8, 4))
if (connection->BackendMinimumVersion(8, 4))
sql += GetGrant(wxT("arwdDxt"), wxT("TABLE ") + tabname);
else if (connection->BackendMinimumVersion(8, 2))
sql += GetGrant(wxT("arwdxt"), wxT("TABLE ") + tabname);

View file

@ -1013,10 +1013,8 @@ wxString dlgView::GetSql()
else
AppendOwnerNew(sql, wxT("TABLE ") + qtIdent(cbSchema->GetValue()) + wxT(".") + qtIdent(GetName()));
if (connection->BackendMinimumVersion(16, 0) && chkMaterializedView->GetValue())
sql += GetGrant(wxT("arwdRxtm"), wxT("TABLE ") + qtIdent(cbSchema->GetValue()) + wxT(".") + qtIdent(GetName()));
else
sql += GetGrant(wxT("arwdRxt"), wxT("TABLE ") + qtIdent(cbSchema->GetValue()) + wxT(".") + qtIdent(GetName()));
sql += GetGrant(wxT("arwdRxt"), wxT("TABLE ") + qtIdent(cbSchema->GetValue()) + wxT(".") + qtIdent(GetName()));
if (connection->BackendMinimumVersion(9, 3) && chkMaterializedView->GetValue())
AppendComment(sql, wxT("MATERIALIZED VIEW ") + qtIdent(cbSchema->GetValue()) + wxT(".") + qtIdent(GetName()), view);

View file

@ -167,10 +167,7 @@ void frmGrantWizard::Go()
wxString privList = wxT("INSERT,SELECT,UPDATE,DELETE,TRUNCATE,REFERENCES,TRIGGER");
const char *privChar = "arwdDxt";
if (conn && conn->BackendMinimumVersion(16, 0)) {
privChar = "arwdDxtm";
privList += ",MAINTAIN";
}
switch (object->GetMetaType())
{
case PGM_DATABASE:
@ -292,10 +289,7 @@ wxString frmGrantWizard::GetSql()
tmp = securityPage->GetGrant(wxT("r"), wxT("TABLE ") + obj->GetQuotedFullIdentifier());
}
else
if (conn && conn->BackendMinimumVersion(16, 0))
tmp = securityPage->GetGrant(wxT("arwdDxtm"), obj->GetTypeName().Upper() + wxT(" ") + obj->GetQuotedFullIdentifier());
else
tmp = securityPage->GetGrant(wxT("arwdDxt"), obj->GetTypeName().Upper() + wxT(" ") + obj->GetQuotedFullIdentifier());
tmp = securityPage->GetGrant(wxT("arwdDxt"), obj->GetTypeName().Upper() + wxT(" ") + obj->GetQuotedFullIdentifier());
break;
}

View file

@ -986,7 +986,7 @@ wxString pgDatabase::GetDefaultPrivileges(const wxChar &cType, wxString strDefPr
{
case 'r':
strType = wxT("TABLES");
strSupportedPrivs = wxT("arwdDxtm");
strSupportedPrivs = wxT("arwdDxt");
break;
case 'S':
strType = wxT("SEQUENCES");

View file

@ -1036,7 +1036,6 @@ wxString pgObject::GetPrivilegeGrant(const wxString &allPattern, const wxString
AppendRight(rights, acl, 'R', wxT("RULE"), column);
AppendRight(rights, acl, 'x', wxT("REFERENCES"), column);
AppendRight(rights, acl, 't', wxT("TRIGGER"), column);
AppendRight(rights, acl, 'm', wxT("MAINTAIN"), column);
AppendRight(rights, acl, 'X', wxT("EXECUTE"), column);
AppendRight(rights, acl, 'U', wxT("USAGE"), column);
AppendRight(rights, acl, 'C', wxT("CREATE"), column);
@ -2105,8 +2104,6 @@ wxString pgObject::GetPrivilegeName(wxChar privilege)
return wxT("REFERENCES");
case 't':
return wxT("TRIGGER");
case 'm':
return wxT("MAINTAIN");
case 'U':
return wxT("USAGE");
case 'X':

View file

@ -720,9 +720,7 @@ wxString pgTable::GetSql(ctlTree *browser)
sql += wxT(";\n")
+ GetOwnerSql(7, 3);
if (GetConnection()->BackendMinimumVersion(16, 0))
sql += GetGrant(wxT("arwdDxtm"));
else if (GetConnection()->BackendMinimumVersion(8, 4))
if (GetConnection()->BackendMinimumVersion(8, 4))
sql += GetGrant(wxT("arwdDxt"));
else if (GetConnection()->BackendMinimumVersion(8, 2))
sql += GetGrant(wxT("arwdxt"));

View file

@ -314,9 +314,8 @@ wxString pgView::GetSql(ctlTree *browser)
+ wxT("\n\n")
+ GetOwnerSql(7, 3, wxT("TABLE ") + GetQuotedFullIdentifier());
}
if (GetConnection()->BackendMinimumVersion(16, 0) && IsMatViewFlag)
sql += GetGrant(wxT("arwdxtm"), wxT("TABLE ") + GetQuotedFullIdentifier());
else if (GetConnection()->BackendMinimumVersion(8, 2))
if (GetConnection()->BackendMinimumVersion(8, 2))
sql += GetGrant(wxT("arwdxt"), wxT("TABLE ") + GetQuotedFullIdentifier());
else
sql += GetGrant(wxT("arwdRxt"), wxT("TABLE ") + GetQuotedFullIdentifier());