pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedFunction security?
3+ messages / 3 participants
[nested] [flat]
* Function security?
@ 1999-06-15 17:09 stevew <stevew@bigeric.force9.co.uk>
0 siblings, 1 reply; 3+ messages in thread
From: stevew @ 1999-06-15 17:09 UTC (permalink / raw)
To: pgsql-sql
I wish to control access to some tables, so I do not want to grant
select to all users. Instead I would like to use some functions which
return the info.
So I have some tables owned by admin
I have a user who does not have select permission on the tables owned by
admin.
admin has created some functions which perform some selects on admin's
tables.
When user runs these functions, user gets permission denied.
Is there a way to let the user be admin when running the functions ????
You can do this with Oracle.
Any help appreciated
Regards,
Steve
^ permalink raw reply [nested|flat] 3+ messages in thread
* RE: [SQL] Function security?
@ 1999-06-15 17:34 Jackson, DeJuan <djackson@cpsgroup.com>
0 siblings, 0 replies; 3+ messages in thread
From: Jackson, DeJuan @ 1999-06-15 17:34 UTC (permalink / raw)
To: stevew <stevew@bigeric.force9.co.uk>; pgsql-sql
You should be able to accomplish this with views. Check out the docs on
views and the rewrite system.
-DEJ
> -----Original Message-----
> From: stevew [SMTP:stevew@bigeric.force9.co.uk]
> Sent: Tuesday, June 15, 1999 12:09 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Function security?
>
> I wish to control access to some tables, so I do not want to grant
> select to all users. Instead I would like to use some functions which
> return the info.
>
> So I have some tables owned by admin
> I have a user who does not have select permission on the tables owned by
> admin.
> admin has created some functions which perform some selects on admin's
> tables.
> When user runs these functions, user gets permission denied.
>
> Is there a way to let the user be admin when running the functions ????
>
> You can do this with Oracle.
>
> Any help appreciated
>
> Regards,
>
> Steve
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [SQL] Function security?
@ 1999-06-16 10:50 Jan Wieck <wieck@debis.com>
parent: stevew <stevew@bigeric.force9.co.uk>
0 siblings, 0 replies; 3+ messages in thread
From: wieck@debis.com @ 1999-06-16 10:50 UTC (permalink / raw)
To: stevew@bigeric.force9.co.uk; +Cc: pgsql-sql
>
> I wish to control access to some tables, so I do not want to grant
> select to all users. Instead I would like to use some functions which
> return the info.
>
> So I have some tables owned by admin
> I have a user who does not have select permission on the tables owned by
> admin.
> admin has created some functions which perform some selects on admin's
> tables.
> When user runs these functions, user gets permission denied.
>
> Is there a way to let the user be admin when running the functions ????
>
> You can do this with Oracle.
PostgreSQL doesn't support this kind of SETUID for functions
or trigger procedures up to now (there are plans to do so but
it didn't make it for v6.5).
You could use a view instead, which presents the data you
want to make accessible, and grant the required permissions
on the view. The view should not contain any function calls
that internally do their own queries (usually over SPI)
because these function internal queries are again executed
under the current users permissions and would probably fail.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck@debis.com (Jan Wieck) #
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1999-06-16 10:50 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-06-15 17:09 Function security? stevew <stevew@bigeric.force9.co.uk>
1999-06-16 10:50 ` Jan Wieck <wieck@debis.com>
1999-06-15 17:34 RE: [SQL] Function security? Jackson, DeJuan <djackson@cpsgroup.com>
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