0

We have a small network of users accessing our QGIS data stored on a PostGIS database (in 3 schemas) which sits on my local drive in my computer. This drive is then shared with the others. Due to the other users being beginners in the GIS world I created a number of layer files (.qlr) for them which point back to the data in my PostGIS database. They can only see these layer files.

But I've just realised when they use these layer files they can still edit, add and remove the data.

How do I restrict this?

Is there a simple way in QGIS or even Windows? (setting permissions on the sharing folders does not seem to work)

The database was created through something called 'pgAdmin 4' and I've tried adding another user/role with different privileges but I can't seem to get that to work its seems to deny access completely or its all still wide open.

The privileges I can alter seem to be too high up the hierarchy all I need to restrict is the ability to write and delete to the schema's and tables, leaving myself with editing rights.

I have no idea how to write in SQL, I'm a geographer not IT. There is no Database Administrator here only me and I made this database just by following the steps on the pgAdmin help pages and some luck. So Im seeking idiot proof help.

1

That is best done through the PostgreSQL permission system.

Create database users for the people to access the database. Then grant them SELECT on the tables that contain the layer data and USAGE on the schemas containing these tables. For example:

GRANT USAGE ON SCHEMA myschema TO auser;
GRANT SELECT ON myschema.mytable TO auser;
| improve this answer | |
  • Thanks for this but where do I actually type this stuff, I can see nowhere to enter text in pgAdmin 4 which is the interface i'm using – Matt D Dec 16 '19 at 22:37
  • There is a "Query Tool" included in pgAdmin. You have to select a database, then you can launch it. But if you use the database frequently, I invite you to use the command line client psql instead of pgAdmin, it is more powerful and comfortable. – Laurenz Albe Dec 17 '19 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.