pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Priviliges and Roles
5+ messages / 4 participants
[nested] [flat]

* Priviliges and Roles
@ 2006-02-27 12:09  Dayo Johnson <dayoj@cleanjohn.net>
  0 siblings, 4 replies; 5+ messages in thread

From: Dayo Johnson @ 2006-02-27 12:09 UTC (permalink / raw)
  To: pgsql-admin

Hello,

Is it possible to do the following:
Disallow permission to write to a table (either by UPDATE or INSERT) but 
allow EXECUTE permission on a Function that writes to the table ?

The reason I want to do this is so that I can perform certain checks on 
the data that is being written before I allow it to be written.

Cheers DayoJ




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Priviliges and Roles
@ 2006-02-27 12:21  Andy Shellam <andy.shellam@mailnetwork.co.uk>
  parent: Dayo Johnson <dayoj@cleanjohn.net>
  3 siblings, 0 replies; 5+ messages in thread

From: Andy Shellam @ 2006-02-27 12:21 UTC (permalink / raw)
  To: dayoj@cleanjohn.net; +Cc: pgsql-admin

Hi Dayo,

This is how I understand it, but I might be wrong:
I believe the user who is has permission to execute the function also needs
permissions to perform the table writes.

Regards

Andy

Dayo Johnson  wrote:

> Hello,
> 
> Is it possible to do the following:
> Disallow permission to write to a table (either by UPDATE or INSERT) but 
> allow EXECUTE permission on a Function that writes to the table ?
> 
> The reason I want to do this is so that I can perform certain checks on 
> the data that is being written before I allow it to be written.
> 
> Cheers DayoJ
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
> 
> !DSPAM:14,4402ee2c160447970214199!
> 
> 
> 

_________________________________________________________
This mail sent using V-webmail - http://www.v-webmail.org

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Priviliges and Roles
@ 2006-02-27 12:22  CaT <cat@zip.com.au>
  parent: Dayo Johnson <dayoj@cleanjohn.net>
  3 siblings, 0 replies; 5+ messages in thread

From: CaT @ 2006-02-27 12:22 UTC (permalink / raw)
  To: Dayo Johnson <dayoj@cleanjohn.net>; +Cc: pgsql-admin

On Mon, Feb 27, 2006 at 12:09:48PM +0000, Dayo Johnson wrote:
> Hello,
> 
> Is it possible to do the following:
> Disallow permission to write to a table (either by UPDATE or INSERT) but 
> allow EXECUTE permission on a Function that writes to the table ?
> 
> The reason I want to do this is so that I can perform certain checks on 
> the data that is being written before I allow it to be written.

I'm no expert but check out triggers. That should allow you to whatnot
the data and fail/pass the insert or update.

See: http://www.postgresql.org/docs/8.1/interactive/triggers.html

-- 
    "To the extent that we overreact, we proffer the terrorists the
    greatest tribute."
    	- High Court Judge Michael Kirby



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Priviliges and Roles
@ 2006-02-27 13:40  Dayo Johnson <dayoj@cleanjohn.net>
  parent: Dayo Johnson <dayoj@cleanjohn.net>
  3 siblings, 0 replies; 5+ messages in thread

From: Dayo Johnson @ 2006-02-27 13:40 UTC (permalink / raw)
  To: Jerry Sievers <jerry@jerrysievers.com>; +Cc: pgsql-admin

Jerry Sievers wrote:
> Dayo Johnson <dayoj@cleanjohn.net> writes:
>
>   
>> Is it possible to do the following:
>> Disallow permission to write to a table (either by UPDATE or INSERT) but 
>> allow EXECUTE permission on a Function that writes to the table ?
>>     
>
> Study up on the 'security definer' option in the manual sections on
> user defined functions.
>
> HTH
>   
Thank you, I believe that sorts me out  :-)

Cheers DayoJ




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Priviliges and Roles
@ 2006-02-27 18:39  Bruno Wolff III <bruno@wolff.to>
  parent: Dayo Johnson <dayoj@cleanjohn.net>
  3 siblings, 0 replies; 5+ messages in thread

From: Bruno Wolff III @ 2006-02-27 18:39 UTC (permalink / raw)
  To: Dayo Johnson <dayoj@cleanjohn.net>; +Cc: pgsql-admin

On Mon, Feb 27, 2006 at 12:09:48 +0000,
  Dayo Johnson <dayoj@cleanjohn.net> wrote:
> Hello,
> 
> Is it possible to do the following:
> Disallow permission to write to a table (either by UPDATE or INSERT) but 
> allow EXECUTE permission on a Function that writes to the table ?
> 
> The reason I want to do this is so that I can perform certain checks on 
> the data that is being written before I allow it to be written.

You can use SECURITY DEFINER functions to do this. Those functions run
with the access rights of the function creator, rather than the executor.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2006-02-27 18:39 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-27 12:09 Priviliges and Roles Dayo Johnson <dayoj@cleanjohn.net>
2006-02-27 12:21 ` Andy Shellam <andy.shellam@mailnetwork.co.uk>
2006-02-27 12:22 ` CaT <cat@zip.com.au>
2006-02-27 13:40 ` Dayo Johnson <dayoj@cleanjohn.net>
2006-02-27 18:39 ` Bruno Wolff III <bruno@wolff.to>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox