Opened 14 years ago

Closed 14 years ago

#2689 closed enhancement (fixed)

Dealing with more sophisticated PostGIS table permissions

Reported by: martin Owned by: nobody
Priority: minor: annoyance Milestone: Version 1.5.0
Component: Data Provider Version: Trunk
Keywords: Cc:
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: no

Description

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 ?

Change History (1)

comment:1 by jef, 14 years ago

Priority: major: does not work as expectedminor: annoyance
Resolution: fixed
Status: newclosed
Type: bugenhancement

duplicate of #2468.

Note: See TracTickets for help on using tickets.