Re: current_user versus current_role

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: current_user versus current_role
Date: 2005-10-05 13:32:51
Message-ID: 20051005133251.GJ5239@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 05, 2005 at 03:17:25PM +0200, Pavel Stehule wrote:

Hi,

> I used info from current_user for log. about some operations (who, when,
> ..). What I can see, current_user is equal current_role function. I had
> problem with it, because user (if is member of any group role) can change
> his identity. example: peter is member of role users. But peter can do set
> role to users. From this moment I lost possibility of get identity if user,
> because current_user returns users and not peter. I can check it (if some
> user changed identity) ~ by exampl. test if role has login privilegia, and
> if not I can stop any operations.

I believe you can use session_user for this.

--
Alvaro Herrera Developer, http://www.PostgreSQL.org
"Amanece. (Ignacio Reyes)
El Cerro San Cristóbal me mira, cínicamente, con ojos de virgen"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Devrim GUNDUZ 2005-10-05 14:32:40 Re: Slony RPM issue
Previous Message Pavel Stehule 2005-10-05 13:17:25 current_user versus current_role