Help using user rights

Started by Valentin Militaruover 19 years ago3 messagesgeneral
Jump to latest
#1Valentin Militaru
valentin.militaru@telcor.ro

Hello,

I have a question regarding user rights.

I have one user in postgres8.01. which connects from a webserver and inserts
some data into a table. It only has INSERT access on that table.
ON the other hand, on the same table a have an after-insert trigger which
executes a function owned by a more powerful user.
My problem is that when I try to insert some data with the webserver user,
PostgreSQL wants that user to have access to all the relations used in the
trigger function.

Is there any way to avoid granting the light user with all those rigths?
Thank you very much!

--
Cu respect,
Valentin Militaru
Telcor Communications
Tel: 0316.900.015
Tel.Mobil:0741.168.267
Fax: 0316.900.001

Prezentul mesaj si orice fisier atasat constituie  informatie confidentiala si
este proprietatea exclusiva a Telcor Communications SRL. Mesajul se adreseaza
numai persoanei fizice sau juridice mentionata ca destinatara,
precum si persoanelor autorizate sa-l primeasca. In cazul in care nu sunteti
destinatarul vizat sau persoana autorizata  sa primiti acest mesaj, va aducem
la cunostinta ca dezvaluirea, copierea, distribuirea sau initierea unor
actiuni pe baza prezentei informatii sunt strict interzise si atrag
raspunderea  dvs. civila si penala. Daca ati primit acest mesaj dintr-o
eroare, va rugam sa ne anuntati imediat  si sa-l stergeti apoi din sistemul
dvs.  Nu putem garanta ca transmisia acestui mesaj este securizata sau fara
erori.

#2Valentin Militaru
valentin.militaru@telcor.ro
In reply to: Valentin Militaru (#1)
Fwd: Help using user rights

Hello,

I have a question regarding user rights.

I have one user in postgres8.01. which connects from a webserver and inserts
some data into a table. It only has INSERT access on that table.
ON the other hand, on the same table a have an after-insert trigger which
executes a function owned by a more powerful user.
My problem is that when I try to insert some data with the webserver user,
PostgreSQL wants that user to have access to all the relations used in the
trigger function.

Is there any way to avoid granting the light user with all those rigths?
Thank you very much!

#3Martijn van Oosterhout
kleptog@svana.org
In reply to: Valentin Militaru (#2)
Re: Fwd: Help using user rights

On Thu, Sep 07, 2006 at 02:12:57PM +0300, Valentin Militaru wrote:

I have one user in postgres8.01. which connects from a webserver and inserts
some data into a table. It only has INSERT access on that table.
ON the other hand, on the same table a have an after-insert trigger which
executes a function owned by a more powerful user.
My problem is that when I try to insert some data with the webserver user,
PostgreSQL wants that user to have access to all the relations used in the
trigger function.

Is there any way to avoid granting the light user with all those rigths?

You could declare the function "SECURITY DEFINER", then it will always
have the rights of the person who created the trigger.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.