Stephen Frost <[EMAIL PROTECTED]> writes: > * Tom Lane ([EMAIL PROTECTED]) wrote: >> The problem I have with the spec's way is that it creates a disconnect >> between the privilege environment seen at the outer level and the >> environment seen within SECURITY DEFINER functions
> Essentially the union behavior is what the spec seems to say- except > that only one or the other is valid inside a SECURITY DEFINER, as I > understand it. So, you make everything do the union, but when you go > into a SECURITY DEFINER function you set the one-not-set to NULL and > handle that correctly in the union. My understanding of things is that per spec, a SECURITY DEFINER function can be owned by either a user or a role, and so within the function either CURRENT_USER or CURRENT_ROLE would return the owner and the other would return NULL. Emulating this would require a hard distinction between users and roles that is simply not there in our implementation, which is why I think they should both return the owner. > Right, I would expect it to drop privileges when rolinherit = true. The > second issue is one reason I don't particularly care for locking it into > the catalog- it means we're building the system in such a way as to be > unable to support what Oracle (at least) does today. If we end up > needing to support it later, or wanting to, perhaps because the spec > follows Oracle's lead and adds SET ROLE ALL, then we've got alot that > would need to be changed because things have become dependent on the > catalog directly. To some extent SET ROLE ALL can be emulated by ALTER USER ... INHERIT. I'm of two minds about whether an unprivileged user should be allowed to adjust his own rolinherit flag --- in most cases it seems pretty harmless (and Oracle evidently thinks it is) --- but one could imagine that the roles have been set up on the assumption that you can't get more than one role's privileges at a time. INHERIT (or SET ROLE ALL) would break that assumption, and perhaps allow people to do unwanted stuff. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly