[awitney@sgul.ac.uk: Re: Access management for DB project.] - Mailing list pgsql-general

From Bohdan Linda
Subject [awitney@sgul.ac.uk: Re: Access management for DB project.]
Date
Msg-id 20050908112535.GB13855@bafster.chello.upc.cz
Whole thread Raw
List pgsql-general
Tanks guys,
That was exactly what I was looking for.

B.
On 8/9/05 11:08 am, "Bohdan Linda" <bohdan.linda@seznam.cz> wrote:

>
> Hi,
>
> I started thinking of some security access management. Basically imagine
> this scenario according users:
>
> 1) Writer does only inserts to black hole.
>
> 2) Reader does only reports on inserted data, cannot modify or add
> anything
>
> 3) Maintainer can run a task on the data, but cannot read or add anything.
> The task has to have read/write access to the tables.
>
> The first 2 types are easily solvable, but with the third type I have
> problem. I have created task in plpgsql, I granted permissions to an user
> to execute the task, but revoked on him all rights to tables. Logically
> task failed.

You could create the function with SECURITY DEFINER, that way the function
will have the permissions of the user that creates it as opposed to the user
that runs it

CREATE my_func(int) RETURNS int SECURITY DEFINER AS '.....



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

pgsql-general by date:

Previous
From: "pobox@verysmall.org"
Date:
Subject: Re: change column data type from smallint to integer
Next
From: "Matt"
Date:
Subject: Bash script to update sequences