Don't load group roles and old-style groups on the security tab on 8.1 and higher...
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Thu, 1 May 2008 19:34:47 +0000 (19:34 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Thu, 1 May 2008 19:34:47 +0000 (19:34 +0000)
Correctly quote role names when reverse engineering ACLs.

git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7246 a7884b65-44f6-0310-8a51-81a127f17b15

CHANGELOG
pgadmin/dlg/dlgProperty.cpp
pgadmin/schema/pgObject.cpp

index 288eb9a74f574a4a9990c8a12859aacb8de332c9..489d15027eb0e4519f56586c5122bce8419ac311 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -36,6 +36,9 @@ Changes
 
 Date       Dev Ver    Change details
 ---------- --- -----  --------------
+2008-05-01 DP  1.8.3  Don't load group roles and old-style groups on the
+                      security tab on 8.1 and higher.
+2008-05-01 DP  1.8.3  Correctly quote role names when reverse engineering ACLs.
 2008-04-20 DP  1.8.3  Don't allow the user to attempt to remove columns from
                       an existing index or index constraint.
 2008-04-08 DP  1.8.3  Disable the RULE privilege on 8.2+ for views per Erwin.
index df9316ccda06cba9d939587e92448ad1fa54a42a..0401018fa969ead88d9ae0fca30967dc576c5d4b 100644 (file)
@@ -1379,6 +1379,9 @@ void dlgSecurityProperty::AddGroups(ctlComboBox *comboBox)
     if (!((securityPage && securityPage->cbGroups) || comboBox))
         return;
 
+       if (connection->BackendMinimumVersion(8, 1))
+               return;
+
     pgSet *set=connection->ExecuteSet(wxT("SELECT groname FROM pg_group ORDER BY groname"));
 
     if (set)
index 9f343cb508f6653261668cb24f565616196d2250..0c0a08d4f6df3fa9a697521459badae11d9385ea 100644 (file)
@@ -616,9 +616,19 @@ wxString pgObject::GetGrant(const wxString& allPattern, const wxString& _grantFo
             else
             {
                 if (user.Left(6) == wxT("group "))
-                    user = wxT("GROUP ") + qtIdent(user.Mid(6));
+                               {
+                                       if (user.Mid(6).StartsWith(wxT("\\\"")) && user.Mid(6).EndsWith(wxT("\\\"")))
+                        user = wxT("GROUP ") + qtIdent(user.Mid(8, user.Length() - 10));
+                                       else
+                                               user = wxT("GROUP ") + qtIdent(user.Mid(6));
+                               }
                 else
-                    user = qtIdent(user);
+                               {
+                                       if (user.StartsWith(wxT("\\\"")) && user.EndsWith(wxT("\\\"")))
+                        user = qtIdent(user.Mid(2, user.Length() - 4));
+                                       else
+                                               user = qtIdent(user);
+                               }
             }
 
             grant += GetPrivileges(allPattern, str, grantFor, user);