Received: from imo-r17.mail.aol.com (imo-r17.mx.aol.com [152.163.225.71]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBQHNnL44671; Tue, 26 Dec 2000 12:23:49 -0500 (EST) (envelope-from jmoschet@netscape.net) Received: from jmoschet@netscape.net by imo-r17.mx.aol.com (mail_out_v28.35.) id k.f0.5ccd9b (16237); Tue, 26 Dec 2000 12:24:08 -0500 (EST) Received: from netscape.com (aimmail05.aim.aol.com [205.188.144.197]) by air-in03.mx.aol.com (v77.31) with ESMTP; Tue, 26 Dec 2000 12:24:08 -0500 Date: Tue, 26 Dec 2000 12:24:08 -0500 From: jmoschet@netscape.net To: pgsql-admin@postgresql.org, pgsql-hackers@postgresql.org Subject: Permissions on Stored Procedures Mime-Version: 1.0 Message-ID: <4F84075A.3A91673C.009EFA21@netscape.net> X-Mailer: Franklin Webmailer 1.0 Content-Type: text/plain; charset="us-ascii" X-Archive-Number: 200012/149 X-Sequence-Number: 345 I've been searching the lists and found a similar question but there have no replies. What I would like to be able to do in Postgres is give users/groups the ability to execute stored procedures on a per procedure basis. I am looking into the Rules system, thinking that this is acheiveable through the use of query rewriting, dummy tables and _insert, _delete, _update rules. I see in the internals.ps (docs directory) file there is an example (2.5.8 / pg 49-50) of creating a dummy table and a rule that gets executed when someone issues a SELECT on that dummy table. The rule defines the actual query which is executed, so the *user* is none the wiser. That's a start. It seems that keeping track of *dummy* tables could get hairy and somone cleaning up could accidentally remove a dummy table and disable a whole mess of things inadvertenty. It would appear to be possible to set ACLs on a dummy table to only allow certain users/groups to execute the select, insert, update or delete on the dummy table itself. Thereby using the built-in postgres security to intervene and before the rules are ever executed. There is an example of the use of a rule to prevent an insert on a table that uses a special naming convention, _insert that automatically gets executed when the INSERT is issued. (and similarly for the _select, _update and _delete) (PostgreSQL: Introduction and Concepts / Momjian, pg. 149) Now if I'm way off and these scenarios are not possible, it would be nice to have ACL's on entries in the pg_proc table or an additional entry in pg_class for each stored proc/function (but that seems unlikely as it seems this would affect other parts of the postgres subsystem) and have the 'traffic-cop' check the permissions on the functions for us. Thanks. John Moschetto attendee OSDN/OSDB Summit Oct 30-31 2000 - Hayes Mansion San Jose, California __________________________________________________________________ Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/