security permissions for functions

From: Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr>
To: pgsql-general(at)postgresql(dot)org
Subject: security permissions for functions
Date: 2007-03-08 16:28:54
Message-ID: 45F039C6.4060009@zg.htnet.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

How can I assign execute permission to a role for a single function
inside schema.

For example
I create schema example;
function example.simple_select()
and user test_user;

If I grant usage on schema example to user test_user as
GRANT USAGE ON SCHEMA example TO test_user;

I can do select * from example.simple_select();

But I don't want this user to be able to select from other functions, so I
want something like

GRANT EXECUTE ON FUNCTION example.simple_select() TO test_user;

but unless the user has usage rights on schema example he can't select
from this function;

I'm using SECURITY DEFINER so that user can execute function without
permissions for
single commands.

Is this a bug or something?
because grant usage on schema doesn't assume select rights on views and
tables, but it does on functions.

Regards,
Rikard

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alan Hodgson 2007-03-08 16:32:12 Re: OT: Canadian Tax Database
Previous Message Ted Byers 2007-03-08 16:15:52 Re: OT: Canadian Tax Database