[QGIS-trac] [Quantum GIS] #2689: Dealing with more sophisticated
PostGIS table permissions
Quantum GIS
qgis at qgis.org
Sun May 2 17:49:52 EDT 2010
#2689: Dealing with more sophisticated PostGIS table permissions
------------------------------------------------+---------------------------
Reporter: martin | Owner: nobody
Type: bug | Status: new
Priority: major: does not work as expected | Milestone: Version 1.5.0
Component: Data Provider | Version: HEAD
Keywords: | Platform_version:
Platform: Debian | Must_fix: No
Status_info: 0 |
------------------------------------------------+---------------------------
See also: http://lists.osgeo.org/pipermail/qgis-developer/2010-
April/009752.html
I'm trying to make use of the nice PostgreSQL feature which allows me
to grant different permissions on different columns of a table to the
user.
To be more precise, the table has a 'serial'-type "ogc_fid", a
'geometry'-type "wkb_geometry" plus a few more columns, of which a
'timestamp'-type column is filled via INSERT/UPDATE trigger.
SELECT/DELETE is granted to the user on the _entire_ record, but
INSERT/UPDATE is granted just on the "wkb_geometry" column.
Everything's fine as long as I'm filling the table via 'ogr2ogr'
("-append"), the geometries are getting in, the serial and the trigger
are filling their respective columns quite nicely. Thus I assume I've
set the grant's properly :-)
Now, when trying to edit the layer in QGIS, we're permitted to move a
vertex of a polygon .... Well, I didn't try to save the result to the
DB, but QGIS at least activates the note tool in edit mode - so I
simply believe it's going to work.
BUT we're not permitted to insert a new polygon (copied from a
different layer) via the paste feature, as long as the grant's are set
up as explained above. The paste item in the edit menu simply remains
greyed out and Ctrl-V doesn't insert anything.
The source layer of the planned copy-and-paste action is imported into
QGIS from a Shapefile, of which I've removed the .dbf-file, and thus
does _not_ contain any attributes which might conflict with the (write
protected columns in the) target PostGIS layer.
Granting INSERT/UPDATE on the entire record would serve as a
workaround, but contradicts my plan of preserving the non-geometry
columns agains unwanted edits.
Can anyone confirm ? Any chance to let QGIS focus on the geometry
column when retrieving table permissions from PostgreSQL while deciding
over the permitted actions ?
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/2689>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list