Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've made a plugin asking for login credentials to a DB. Once logged in, the plugin is loading some layers from the DB. In the DB there are both admin and "normal" users.

I've saved two styles to the DB from the UI as default style for their layer respectively (seems you have to have DB admin rights to be able to save them).

Once I've saved the styles to the db I'm not able to see where they are stored i.e., I can't see any new tables. (I expected the styles to be saved in a table)

Running QGIS and the plugin again (as admin user) the layer styles are loaded automatically.

But, running QGIS and the plugin again (as normal user rnd) they are not loaded automatically. I then try to load the styles from the DB (from the GUI), but no styles are loaded.

Two questions.

  1. How are the layer styles stored in the DB?
  2. Is there a way to load the layer styles without DB admin rights?
share|improve this question
    
Does your normal users were granted access to the your tables? how about to your style tables? –  Alexandre Neto Apr 2 at 8:58
    
My normal users have access to the layers tables. They get loaded as they should. Regarding style tables, that is the problem. I had expected there to be style tables but can't see them in the DB using pgAdmin. Could be that styles are stored in another way, but how? If I could locate any style tables I could give normal users access tights to them. –  user28233 Apr 2 at 9:07

1 Answer 1

up vote 4 down vote accepted

The styles are normally saved in public.layer_styles.

Being in the public schema it should be accessible to every user. If not, make sure it becomes using:

GRANT SELECT ON TABLE public.layer_styles TO users;
-- "users" is a group with all your #normal users
share|improve this answer
    
I was unaware that styles were saved in public (working with a db with several schema). –  user28233 Apr 2 at 14:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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