Log Message:
-----------
Tablespace ACLs

Modified Files:
--------------
    pgadmin3/src/include:
        dlgTablespace.h (r1.1 -> r1.2)
    pgadmin3/src/schema:
        pgTablespace.cpp (r1.4 -> r1.5)
    pgadmin3/src/ui:
        ctlSecurityPanel.cpp (r1.3 -> r1.4)
        dlgTablespace.cpp (r1.2 -> r1.3)

Index: dlgTablespace.h
===================================================================
RCS file: /projects/pgadmin3/src/include/dlgTablespace.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lsrc/include/dlgTablespace.h -Lsrc/include/dlgTablespace.h -u -w -r1.1 -r1.2
--- src/include/dlgTablespace.h
+++ src/include/dlgTablespace.h
@@ -17,7 +17,7 @@
 
 class pgTablespace;
 
-class dlgTablespace : public dlgProperty
+class dlgTablespace : public dlgSecurityProperty
 {
 public:
     dlgTablespace(frmMain *frame, pgTablespace *node=0);
Index: pgTablespace.cpp
===================================================================
RCS file: /projects/pgadmin3/src/schema/pgTablespace.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/schema/pgTablespace.cpp -Lsrc/schema/pgTablespace.cpp -u -w -r1.4 -r1.5
--- src/schema/pgTablespace.cpp
+++ src/schema/pgTablespace.cpp
@@ -135,6 +135,7 @@
         properties->AppendItem(_("OID"), GetOid());
         properties->AppendItem(_("Owner"), GetOwner());
         properties->AppendItem(_("Location"), GetLocation());
+        properties->AppendItem(_("ACL"), GetAcl());
     }
 }
 
@@ -163,7 +164,7 @@
 
 
     pgSet *tablespaces = collection->GetServer()->ExecuteSet(
-        wxT("SELECT ts.oid, spcname, spclocation, pg_get_userbyid(spcowner) as 
spcuser FROM pg_tablespace ts\n")
+        wxT("SELECT ts.oid, spcname, spclocation, pg_get_userbyid(spcowner) as 
spcuser, spcacl FROM pg_tablespace ts\n")
         + restriction + wxT(" ORDER BY spcname"));
 
     if (tablespaces)
@@ -176,6 +177,7 @@
             tablespace->iSetOid(tablespaces->GetOid(wxT("oid")));
             tablespace->iSetOwner(tablespaces->GetVal(wxT("spcuser")));
             tablespace->iSetLocation(tablespaces->GetVal(wxT("spclocation")));
+            tablespace->iSetAcl(tablespaces->GetVal(wxT("spcacl")));
 
 
             if (browser)
Index: dlgTablespace.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgTablespace.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lsrc/ui/dlgTablespace.cpp -Lsrc/ui/dlgTablespace.cpp -u -w -r1.2 -r1.3
--- src/ui/dlgTablespace.cpp
+++ src/ui/dlgTablespace.cpp
@@ -29,7 +29,7 @@
 #define txtLocation     CTRL_TEXT("txtLocation")
 
 
-BEGIN_EVENT_TABLE(dlgTablespace, dlgProperty)
+BEGIN_EVENT_TABLE(dlgTablespace, dlgSecurityProperty)
     EVT_TEXT(XRCID("txtName"),                      dlgTablespace::OnChange)
     EVT_TEXT(XRCID("txtLocation"),                  dlgTablespace::OnChange)
     EVT_TEXT(XRCID("cbOwner"),                      dlgTablespace::OnOwnerChange)
@@ -39,7 +39,7 @@
 
 
 dlgTablespace::dlgTablespace(frmMain *frame, pgTablespace *node)
-: dlgProperty(frame, wxT("dlgTablespace"))
+: dlgSecurityProperty(frame, node, wxT("dlgTablespace"), wxT("CREATE"), "C")
 {
     tablespace=node;
     SetIcon(wxIcon(tablespace_xpm));
@@ -55,6 +55,7 @@
 
 int dlgTablespace::Go(bool modal)
 {
+    AddGroups();
     AddUsers(cbOwner);
     txtComment->Disable();
 
@@ -73,7 +74,7 @@
     {
     }
 
-    return dlgProperty::Go(modal);
+    return dlgSecurityProperty::Go(modal);
 }
 
 
@@ -129,6 +130,7 @@
         sql += wxT(" LOCATION ") + qtString(txtLocation->GetValue())
             +  wxT(";\n");
     }
+    sql += GetGrant(wxT("C"), wxT("TABLESPACE ") + name);
     return sql;
 }
 
Index: ctlSecurityPanel.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/ctlSecurityPanel.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lsrc/ui/ctlSecurityPanel.cpp -Lsrc/ui/ctlSecurityPanel.cpp -u -w -r1.3 -r1.4
--- src/ui/ctlSecurityPanel.cpp
+++ src/ui/ctlSecurityPanel.cpp
@@ -270,6 +270,7 @@
 void ctlSecurityPanel::OnDelPriv(wxCommandEvent &ev)
 {
     lbPrivileges->DeleteCurrentItem();
+    ev.Skip();
 }
 
 
@@ -302,6 +303,7 @@
         }
     }
     lbPrivileges->SetItem(pos, 1, value);
+    ev.Skip();
 }
 
 
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to