Re: Design Database, 3 degrees of Users. - Mailing list pgsql-general

From Sam Mason
Subject Re: Design Database, 3 degrees of Users.
Date
Msg-id 20090731131153.GK5407@samason.me.uk
Whole thread Raw
In response to Design Database, 3 degrees of Users.  (Andre Lopes <lopes80andre@gmail.com>)
List pgsql-general
On Fri, Jul 31, 2009 at 12:38:30PM +0100, Andre Lopes wrote:
> I need to design a Database that will handle 3 degrees of users:
>
> Administrators - They can see all the information in the database.
> Managers - They only can see the information of his dependants.
> Dependants - Theirs action must be aprovet by the managers.
>
> Wich the best way to implement this in PostGreSQL? There is some database
> examples doing this? Some OpenSource Project?

Depends on how much this separation should be done inside the database,
and how much outside the database.  Within PG, the things that will help
you are roles[1], views[2], and functions[3] with "security definer"
set.

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

 [1] http://www.postgresql.org/docs/current/static/user-manag.html
 [2] http://www.postgresql.org/docs/current/static/sql-createview.html
 [3] http://www.postgresql.org/docs/current/static/sql-createfunction.html

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: MSSQL to PostgreSQL
Next
From: Merlin Moncure
Date:
Subject: Re: MSSQL to PostgreSQL