Re: [SQL] storing access rights in a postgres database

2006-10-13 Thread Aaron Bono
On 10/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: SELECT id, (SELECT allowed FROM rights WHERE user_id = 1 AND ( (firm_id = projects.firm_id AND project_id = projects.id ANDsubproject_id IS NULL)  OR (firm_id = projects.firm_id AND project_id IS NULL))ORDER BY firm_

Re: [SQL] storing access rights in a postgres database

2006-10-10 Thread Dirk Jagdmann
Hello tv, I think in your case the PostgreSQL array column type really fits well. I would just add an array of type integer (or whatever your primary key in your role table is) to your company, project, module, ... tables. Then you can easy check if a role has access to the project row by checkin

[SQL] storing access rights in a postgres database

2006-10-10 Thread tv
Hi, we are developping a web application in which we need to manage access to several types of objects, the most important objects are 'company', 'projects', 'subproject', 'module' (and several others but that's not important for now). In general these objects constitute a tree, as for example eac