Help with access check

Поиск
Список
Период
Сортировка
Искать

Help with access check

От:
Thomas Hallgren <thhal@mailblocks.com>
Дата:
Hi,
 From code inside a C-function, given the AclId of a user and the Oid of 
a Schema, what's the most efficient way to find out if the user has been 
granted CREATE on the schema?

Thanks,
Thomas Hallgren

Re: Help with access check

От:
Alvaro Herrera <alvherre@dcc.uchile.cl>
Дата:
On Sun, Feb 06, 2005 at 03:28:31PM +0100, Thomas Hallgren wrote:

Hi,

> From code inside a C-function, given the AclId of a user and the Oid of 
> a Schema, what's the most efficient way to find out if the user has been 
> granted CREATE on the schema?

See src/backend/catalog/aclchk.c, function pg_namespace_aclcheck().

Why would you want to do that directly anyway?

-- 
Alvaro Herrera ()
"La virtud es el justo medio entre dos defectos" (Aristóteles)

Re: Help with access check

От:
Thomas Hallgren <thhal@mailblocks.com>
Дата:
Alvaro Herrera wrote:

>On Sun, Feb 06, 2005 at 03:28:31PM +0100, Thomas Hallgren wrote:
>
>Hi,
>
>  
>
>From code inside a C-function, given the AclId of a user and the Oid of 
>>a Schema, what's the most efficient way to find out if the user has been 
>>granted CREATE on the schema?
>>    
>>
>
>See src/backend/catalog/aclchk.c, function pg_namespace_aclcheck().
>  
>
Great. Thanks!

>Why would you want to do that directly anyway?
>  
>
In PLJava, I use a function to set a schema specific Java classpath that 
functions declared in that schema will use. The setting is permanent 
(i.e. not per session). I want to prevent all users but those that have 
create permission on the schema to set this classpath.

Regards,
Thomas Hallgren


FAQ