Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6548F4763A6 for ; Mon, 11 Nov 2002 11:46:46 -0500 (EST) Received: from localhost.localdomain (unknown [65.217.53.66]) by postgresql.org (Postfix) with ESMTP id AC9D6476392 for ; Mon, 11 Nov 2002 11:46:44 -0500 (EST) Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) by localhost.localdomain (8.12.5/8.12.5) with ESMTP id gABGnE6P009854; Mon, 11 Nov 2002 11:49:15 -0500 Received: from gnvex001.mmrd.com (gnvex001.mmrd.com [192.168.3.55]) by thorn.mmrd.com (8.11.6/8.11.6) with ESMTP id gABGjej02161; Mon, 11 Nov 2002 11:45:40 -0500 Received: from camel.mmrd.com ([172.25.5.213]) by gnvex001.mmrd.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id WK2G0RKV; Mon, 11 Nov 2002 11:45:40 -0500 Subject: Re: Permission on insert rules From: Robert Treat To: Bruce Momjian Cc: josh@agliodbs.com, Luis Sousa , pgsql-sql In-Reply-To: <200211090240.gA92eX412402@candle.pha.pa.us> References: <200211090240.gA92eX412402@candle.pha.pa.us> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 11 Nov 2002 11:45:40 -0500 Message-Id: <1037033140.26585.34.camel@camel> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/166 X-Sequence-Number: 10308 On Fri, 2002-11-08 at 21:40, Bruce Momjian wrote: > Josh Berkus wrote: > > > > Luis, > > > > > Just a question. > > > I'm writing some rules to insert/update some data in my database, and I > > > gave all the privileges on that view to the user, and only select on the > > > tables. > > > When that user inserts data using the view, I thought that was user > > > postgres that will do the rest ! But I got permission denied on those > > > tables. > > > The idea was to create a layer, with the views, giving to that user > > > permission on views to insert and update, and not to tables. > > > Is this possible ? > > > > This is a known problem. > > > > I know that permissions for Functions has been addressed in 7.3. However, I > > am not sure about permissions for updatable views. Tom, Bruce? > > Views have always had their own permissions. > If the functions can fire as there creator instead of there caller, then I would think as long as the creator has insert/update views on the base table, you should be able to do updateable rules and give only permissions to the view for the caller. (Though maybe you have to use triggers rather than rules to do this?) Does that sound right? Robert Treat