X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id ED616D1EB83 for ; Sun, 4 Apr 2004 15:42:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 03663-01 for ; Sun, 4 Apr 2004 12:42:36 -0300 (ADT) Received: from skyhouseconsulting.com (skyhouseconsulting.com [216.93.161.184]) by svr1.postgresql.org (Postfix) with ESMTP id 35F4ED1EAC4 for ; Sun, 4 Apr 2004 12:42:14 -0300 (ADT) Received: from amadeus ([210.18.156.50]) by skyhouseconsulting.com (8.12.10/8.12.10) with ESMTP id i34FgbCV036293 for ; Sun, 4 Apr 2004 10:42:39 -0500 (CDT) (envelope-from jason@openinformatics.com) Received: from jasons by amadeus with local (Exim 3.35 #1 (Debian)) id 1BA9lP-0003kA-00 for ; Sun, 04 Apr 2004 21:12:23 +0530 To: pgsql-interfaces@postgresql.org Subject: View permissions From: jason@openinformatics.com (Jason E. Stewart) Date: 04 Apr 2004 21:12:23 +0530 Message-ID: <87ekr3iwbk.fsf@openinformatics.com> Lines: 39 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/10 X-Sequence-Number: 4831 Hi, I appologize if this is the incorrect list, but it is the only one to which I subscribe. Is it possible to use table permissions to restrict UPDATE's and DELETE's on views? Or does that need to happen in the rules which remap the events? I have a view with the following permissions: genex2=> \dp genex_measured_bioassay_view Access privileges for database "genex2" Schema | Table | Access privileges --------+------------------------------+------------------------------------------------------------------- public | genex_measured_bioassay_view | {=,genex=arwdRxt,"group genex_user=r","group genex_curator=arwd"} My belief was that by restricting members of the genex_user group to SELECT only access, they would not be able to make UPDATE's on the view. But this is not the case, they are able to make updates. I have a rule which re-maps the UPDATE to the underlying table as follows: CREATE RULE GENEX_MEASURED_BIOASSAY_VIEW_upd AS ON UPDATE TO GENEX_MEASURED_BIOASSAY_VIEW DO INSTEAD UPDATE GENEX_MEASURED_BIOASSAY SET "mba_pk" = NEW."mba_pk", "fe_sw_fk" = NEW."fe_sw_fk", "name" = NEW."name", "identifier" = NEW."identifier", "description" = NEW."description", "audit_fk" = NEW."audit_fk" WHERE "mba_pk" = NEW."mba_pk"; Does this rule bypass the permissions on the view? Thanks in advance, jas.