Re: View permissions in 7.1 - Mailing list pgsql-general

From Lieven Van Acker
Subject Re: View permissions in 7.1
Date
Msg-id 3AF1D06E.2E5F4A28@elisa.be
Whole thread Raw
In response to View permissions in 7.1  (Lieven Van Acker <lieven@elisa.be>)
Responses Re: View permissions in 7.1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> Okay, the example you sent me off-list turns out to exhibit one bug
> and one not-yet-implemented feature.  There is a bug in permissions
> checking for insert/update/delete rules (any references therein to
> NEW or OLD should be checked against the rule owner, not the calling
> user).  A patch for that is attached.

Thanks, I'll apply it.

> However, you were also expecting
> that an SQL function call would provide "setuid" behavior, and it
> doesn't.  (I believe changing that is on the TODO list.)  In the
> meantime, you'd need to replace the current_adm() function call in your
> adm_base view rules with explicit subselects, so that the accesses to
> the "users" table are checked against the rule owner rather than the
> calling user.

Well, in fact, -at this point - I don't need setuid, because the function current_adm() has to lookup the effective uid
ofthe calling 
user. The point is I want to filter the records depending on the uid of the user calling the top-level view. So as I
canunderstand, 
views that are called by other views run still within the same session - thus returning the effective uid, right?

Kind Regards,

Lieven.


pgsql-general by date:

Previous
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: Ideal hardware configuration for pgsql/Netra
Next
From: Joel Burton
Date:
Subject: Re: cast bit to boolean?