security permissions for functions - Mailing list pgsql-general

From Rikard Pavelic
Subject security permissions for functions
Date
Msg-id 45F039C6.4060009@zg.htnet.hr
Whole thread Raw
Responses Re: security permissions for functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-general by date:

Previous
From: Kevin Hunter
Date:
Subject: Re: "oracle to postgresql" conversion
Next
From: Alvaro Herrera
Date:
Subject: Re: Tabulate data incrementally