I have set up a PostGIS database (PostgreSQL 15.5, PostGIS 3.4, QGIS 3.34 LTR) which 2 different user groups can access: editor and reader. For simplicity, let's say there are 3 schemas in the database. The schema all_layers contains all tables of the database that both user groups have access to. Additionally, each user group has its own schema, which only they have access to. This schema only contains a QGIS project each:
My issue is with the way QGIS handles PostGIS credentials, especially when using QGIS projects saved to the database. As mentioned in this related question, any credentials saved in a QGIS project override the locally saved credentials, which can lead to giving editor privileges to readers. For this reason, I implemented two separate schemas with separate QGIS projects (I then manually updated the project in the project_reader project while making sure no credentials were saved in the project file). I also have to take into account that the editors need UPDATE privileges to the QGIS project itself, but I want to prohibit them from accidentally saving their credentials into the project file.
Is there a way to have a single QGIS project saved to a schema (like in the following image) in my PostGIS database where the following is given:
- Both user groups (editor and reader) have access to the same schema & project
- The editor can make changes to the project file
- The editor can't accidentally save his/her credentials to the project file, which then provides the readers with more privileges
- And crucially: users don't have to log in 2-3 times each time they open the project file (currently the case)
I am aware of the option of using service config files as described in this post. However, the users accessing the database work at a seperate company and it is not feasible for me to install a service config file on each computer that gets access to the database.