Обсуждение: Simple webuser setup

Поиск
Список
Период
Сортировка

Simple webuser setup

От
msiner@gmail.com
Дата:
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?


Re: Simple webuser setup

От
"Raymond O'Donnell"
Дата:
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
----------------------------------------------------------------------



Re: Simple webuser setup

От
Tino Wildenhain
Дата:
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



Re: Simple webuser setup

От
Tony Caduto
Дата:
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


Re: Simple webuser setup

От
msiner@gmail.com
Дата:
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


Re: Simple webuser setup

От
"Raymond O'Donnell"
Дата:
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
----------------------------------------------------------------------



Re: Simple webuser setup

От
"Raymond O'Donnell"
Дата:
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
----------------------------------------------------------------------