Friday 19 May 2017

postgresql - Prevent export to shapefile from postgis table in QGIS


I have created a centralized database using postgreSQL and created multiple users assigned with different roles i.e. SELECT, UPDATE, MODIFY and DELETE etc.


Example:



CREATE USER hasan WITH PASSWORD 'hasan'


GRANT SELECT ON pois TO hasan




For user 'hasan' i have granted SELECT privileges on pois table which means he can only select and view the data. It works perfectly both in postgres and QGIS environment. The user can only run select query on the table and view the data in QGIS environment and cannot update or delete any record as i expected.


But the problem is in the QGIS environment, when the user right click on the table, he can easily export the table into a shapefile and then edit or update whatever he wants to do.


So my question is what can i do to stop the user from exporting the postgis table to a shapefile in QGIS?



Answer



Once you allow a user to select the data from your database there is no way to prevent them doing what they like with the data. If it is important to you that the user can only view and not edit the data you could consider using a WMS server (e.g GeoServer, MapServer) to render the data on your server and send only an image of the rendered data to the user.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...