[GENERAL] Defining roles

2009-10-26 Thread Michael Gould
In our system we have a hybrid security system. We have tables that I want
to make sure that based on membership in a group that update and/or delete
is not allowed to a specific group. We also have application level security
which is much more granular and is much more job function based.  Our
application is a transportation application, so a user might have insert,
update and delete in order entry but a dispatcher would not have the ability
to delete a order, they must cancel it with a reason code.  These would both
be part of the same ROLE in the database.  Trying to maintain the database
to match the application security would become cumbersome for our customers.

Now for the question, if I specifically revoke a update or delete on a per
table basis for a role to I still have to specifically define what security
attributes they have access on? If this doesn't work, would I give access to
the schema and then just specifically revoke the update or delete
functionality for just the tables I'm looking to protect.

Best Regards

Mike Gould



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Defining roles

2009-10-27 Thread Sam Mason
On Mon, Oct 26, 2009 at 10:32:05AM -0500, Michael Gould wrote:
> In our system we have a hybrid security system.
[...]
> Trying to maintain the database
> to match the application security would become cumbersome for our customers.

Have you looked at using functions protected by "security definer"?  I
tend to use these a lot when I want to enforce any remotely complicated
security properties.  The functions can go away and check whatever
properties you want and allowing you to have a parallel set of checks
going on to the stuff directly supported by PG.

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general