Thread: Queries that return permissions

Queries that return permissions

From
Thom Dyson
Date:



I'm laying the ground work to migrate a database to a web front end.  One
thing I would like is, when generating the HTML,  to display read-only
fields as text, while fields that are updateable as input fields, based on
the permissions that the user has to the table.  This way a  given user
would not be confused trying to change data they have no permission to.

Does anyone know where there is code that will do this sort of thing?

Thom Dyson
Director of Information Services
Sybex, Inc.



Re: Queries that return permissions

From
Joe Conway
Date:
Thom Dyson wrote:
> the permissions that the user has to the table.

> Does anyone know where there is code that will do this sort of thing?

See:
http://www.postgresql.org/docs/current/static/functions-misc.html#FUNCTIONS-MISC-ACCESS-TABLE

HTH,

Joe

Re: Queries that return permissions

From
Thom Dyson
Date:



Oops,  Not running 7.4 yet.  Maybe I should upgrade :)

Thom Dyson
Director of Information Services
Sybex, Inc.



Joe Conway <mail@joeconway.com> wrote on 02/13/2004 10:15:05 AM:

> Thom Dyson wrote:
> > the permissions that the user has to the table.

> > Does anyone know where there is code that will do this sort of thing?

> See:
> http://www.postgresql.org/docs/current/static/functions-misc.
> html#FUNCTIONS-MISC-ACCESS-TABLE

> HTH,

> Joe


Re: Queries that return permissions - D'OH

From
Thom Dyson
Date:



Oh MAN.  I NEED more coffee.  7.3 has this.

Thom Dyson
Director of Information Services
Sybex, Inc.





             Joe Conway
             <mail@joeconway.c
             om>                                                        To
             Sent by:                  Thom Dyson <TDyson@sybex.com>
             pgsql-php-owner@p                                          cc
             ostgresql.org             pgsql-php@postgresql.org
                                                                   Subject
                                       Re: [PHP] Queries that return
             02/13/2004 10:15          permissions
             AM









Thom Dyson wrote:
> the permissions that the user has to the table.

> Does anyone know where there is code that will do this sort of thing?

See:
http://www.postgresql.org/docs/current/static/functions-misc.html#FUNCTIONS-MISC-ACCESS-TABLE


HTH,

Joe

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: Queries that return permissions

From
Christopher Kings-Lynne
Date:
Hi Thom,

Download phpPgAdmin (phppgadmin.sourceforge.net) and look at the
getPrivileges function in classes/database/Postgres.php.

Cheers,

Chris

Thom Dyson wrote:

>
>
>
> I'm laying the ground work to migrate a database to a web front end.  One
> thing I would like is, when generating the HTML,  to display read-only
> fields as text, while fields that are updateable as input fields, based on
> the permissions that the user has to the table.  This way a  given user
> would not be confused trying to change data they have no permission to.
>
> Does anyone know where there is code that will do this sort of thing?
>
> Thom Dyson
> Director of Information Services
> Sybex, Inc.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match