Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4B2C0650510 for ; Sat, 12 Jul 2008 08:30:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 97582-10 for ; Sat, 12 Jul 2008 08:30:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fugue.toroid.org (fugue.toroid.org [85.10.196.113]) by postgresql.org (Postfix) with ESMTP id 0E394650508 for ; Sat, 12 Jul 2008 08:30:44 -0300 (ADT) Received: from penne.toroid.org (penne-vpn [10.8.0.6]) by fugue.toroid.org (Postfix) with ESMTP id 644805584EE; Sat, 12 Jul 2008 13:30:41 +0200 (CEST) Received: by penne.toroid.org (Postfix, from userid 1000) id 8C699ADC364; Sat, 12 Jul 2008 17:00:41 +0530 (IST) Date: Sat, 12 Jul 2008 17:00:41 +0530 From: Abhijit Menon-Sen To: Jaime Casanova Cc: Alvaro Herrera , Jaime Casanova , pgsql-hackers@postgresql.org Subject: Re: Extending grant insert on tables to sequences Message-ID: <20080712113041.GA25112@toroid.org> References: <20080708133244.GB4095@alvh.no-ip.org> <20080709185837.GA27406@toroid.org> <20080709191125.GK3946@alvh.no-ip.org> <20080710031140.GA427@toroid.org> <3073cc9b0807110957w71869487p17fb58cb98abc520@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3073cc9b0807110957w71869487p17fb58cb98abc520@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/612 X-Sequence-Number: 120872 At 2008-07-11 11:57:37 -0500, jcasanov@systemguards.com.ec wrote: > > attached is a new version of the patch, it implements Alvaro's > suggestion and fix a bug i found (it wasn't managing GRANT ALL) :( Looks good to me. > About the SELECT issue, AFAIU Robert doesn't complaint he just asked > what is the use case... if people think it should be removed ok, but > OTOH: why? i don't think that affects anything... As I said, I don't feel too strongly about it. > > ! Granting permission on a table automatically extend > ! permissions to any sequences owned by the table, including > ! sequences tied to SERIAL columns. > Should be "Granting permissions on a table automatically extends those permissions to...". > + if ((istmt.objtype == ACL_OBJECT_RELATION) && (istmt.all_privs || > + (istmt.privileges & (ACL_INSERT | ACL_UPDATE | ACL_SELECT)))) > + { The parentheses around the first comparison can go away, and also the ones around the ACL_* here: > + if (istmt.privileges & (ACL_INSERT)) > + istmt_seq.privileges |= ACL_USAGE; > + if (istmt.privileges & (ACL_UPDATE)) > + istmt_seq.privileges |= ACL_UPDATE; > + if (istmt.privileges & (ACL_SELECT)) > + istmt_seq.privileges |= ACL_SELECT; -- ams