Waldemar Baraldi wrote:
I'm programming a database application that uses the API, but I have
some security issues that I have to manage, so I need to know my access
rights on a table and the "try" technique is not appropiate because if I
get a "Permission denied" then my transaction block is aborted and I
don't want that to happend.
The psql program can read it with the \z option so I know that it can be
done, so, how? from tha API, a query? which?.
Thanks in advance and sorry for my English, I speak Spanish.
H Waldemar,
you can query the system-table "pg_class". The filed "relacl" holds the acl for the
table.
The form is:
{RIGHT[,RIGHT]}
where RIGHT is in the form:
"[user]=[acl-for-user]"
acl-for-user is a combination of the following:
a - insert granted
r - select granted
w - update granted
R - rule granted
Sample Entry:
{"=","admin=arwR","simpleuser=r","updater=w"}
means:
PUBLIC: allowed nothing
admin: insert,select,update,rule
simpleuser: select
updater: update
Hope this works for you.
cu
Martin
--
Martin Neimeier
Ingenieur-Buero Neimeier
Schwarzach / Germany
mailto:[EMAIL PROTECTED] / http://www.ibn.de (under heavy reconstruction)
Tel:+49(6262)912344 / Fax:+49(6262)912347