Unix Technical Forum

Simple webuser setup

This is a discussion on Simple webuser setup within the Pgsql General forums, part of the PostgreSQL category; --> There must be something simple that I am missing, but here is my problem. I am setting up a ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 11:39 AM
msiner@gmail.com
 
Posts: n/a
Default Simple webuser setup

There must be something simple that I am missing, but here is my
problem. I am setting up a standard pg install as a backend to a small
webapp. I want to create a user "webuser" with only enough privileges
to query all of the tables in my database. It has not been working for
me. What is the simplest way to do this? Do I need to start at the
top and then work down (db->schema->table) or is there any cascading
effect? I am still pretty new to web development, so is there a
better/easier way to achieve the same effect?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 11:39 AM
Raymond O'Donnell
 
Posts: n/a
Default Re: Simple webuser setup

On 16 Jul 2006 at 17:12, msiner@gmail.com wrote:

> There must be something simple that I am missing, but here is my
> problem. I am setting up a standard pg install as a backend to a small
> webapp. I want to create a user "webuser" with only enough privileges
> to query all of the tables in my database. It has not been working for
> me. What is the simplest way to do this? Do I need to start at the


You'll need to provide a bit more detail...... what language?
environment? Can you provide some code samples?

--Ray.


----------------------------------------------------------------------

Raymond O'Donnell
Director of Music, Galway Cathedral, Galway, Ireland
rod@iol.ie
----------------------------------------------------------------------



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 11:39 AM
Tino Wildenhain
 
Posts: n/a
Default Re: Simple webuser setup

msiner@gmail.com wrote:
> There must be something simple that I am missing, but here is my
> problem. I am setting up a standard pg install as a backend to a small
> webapp. I want to create a user "webuser" with only enough privileges
> to query all of the tables in my database. It has not been working for
> me. What is the simplest way to do this? Do I need to start at the


what does "is not working for me" mean in detail?

> top and then work down (db->schema->table) or is there any cascading
> effect? I am still pretty new to web development, so is there a
> better/easier way to achieve the same effect?


There is no cascading effect when it comes to permission but if you
dont have permission for a schema you cant access the objects in it :-)

Maybe you can use your schema script and edit it semi-automatically.

Regards
Tino



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 11:39 AM
msiner@gmail.com
 
Posts: n/a
Default Re: Simple webuser setup

I have a db named archive, a schema named library, and a table named
book. I have granted USAGE on library to webuser and SELECT on book to
webuser. When I try to do a select I get an error saying "permission
denied for schema library". I have tried every combination I can think
of, but none seem to work. My real question is just what should I do
to get this effect for the above? What permissions do I need for the
db, schema, and table? I have a user named "webuser" belonging to a
group named "webgroup" and I am granting the above privileges to
webgroup.


Tino Wildenhain wrote:
> msiner@gmail.com wrote:
> > There must be something simple that I am missing, but here is my
> > problem. I am setting up a standard pg install as a backend to a small
> > webapp. I want to create a user "webuser" with only enough privileges
> > to query all of the tables in my database. It has not been working for
> > me. What is the simplest way to do this? Do I need to start at the

>
> what does "is not working for me" mean in detail?
>
> > top and then work down (db->schema->table) or is there any cascading
> > effect? I am still pretty new to web development, so is there a
> > better/easier way to achieve the same effect?

>
> There is no cascading effect when it comes to permission but if you
> dont have permission for a schema you cant access the objects in it :-)
>
> Maybe you can use your schema script and edit it semi-automatically.
>
> Regards
> Tino
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 11:39 AM
Tony Caduto
 
Posts: n/a
Default Re: Simple webuser setup

msiner@gmail.com wrote:
> There must be something simple that I am missing, but here is my
> problem. I am setting up a standard pg install as a backend to a small
> webapp. I want to create a user "webuser" with only enough privileges
> to query all of the tables in my database. It has not been working for
> me. What is the simplest way to do this? Do I need to start at the
> top and then work down (db->schema->table) or is there any cascading
> effect? I am still pretty new to web development, so is there a
> better/easier way to achieve the same effect?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>

You just have to set it at the table level.
You should check out PG Lightning Admin, it has a really nice Grant
Manager that is grid based that makes this sort of thing
very easy to setup.

--
Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best bet for Postgresql Administration


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 11:39 AM
Raymond O'Donnell
 
Posts: n/a
Default Re: Simple webuser setup

On 17 Jul 2006 at 6:08, msiner@gmail.com wrote:

> I have a db named archive, a schema named library, and a table named
> book. I have granted USAGE on library to webuser and SELECT on book
> to webuser. When I try to do a select I get an error saying
> "permission denied for schema library". I have tried every combination


How are you accessing the DB from your web app? What
language/envoronment are you using?

Are you sure that the username/password combination is being passed
along to the DB? - have you tried connecting directly to the DB using
psql, logging in as webuser, and running queries against the DB?

--Ray.


----------------------------------------------------------------------

Raymond O'Donnell
Director of Music, Galway Cathedral, Galway, Ireland
rod@iol.ie
----------------------------------------------------------------------



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-09-2008, 11:39 AM
Raymond O'Donnell
 
Posts: n/a
Default Re: Simple webuser setup

On 17 Jul 2006 at 6:08, msiner@gmail.com wrote:

> to get this effect for the above? What permissions do I need for the
> db, schema, and table? I have a user named "webuser" belonging to a
> group named "webgroup" and I am granting the above privileges to
> webgroup.


All you really need is the appropriate permissions on the
table(s)....I personally don't understand what permissions mean on
databases or schemas, but I've never needed to to grant any.

--Ray.

----------------------------------------------------------------------

Raymond O'Donnell
Director of Music, Galway Cathedral, Galway, Ireland
rod@iol.ie
----------------------------------------------------------------------



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:50 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com