[GENERAL] Row based permissions: at DB or at Application level? - Mailing list pgsql-general

From Thomas Güttler
Subject [GENERAL] Row based permissions: at DB or at Application level?
Date
Msg-id e662fd8a-6001-514c-71e8-01718444f338@thomas-guettler.de
Whole thread Raw
Responses Re: [GENERAL] Row based permissions: at DB or at Application level?  (Daniel Westermann <daniel.westermann@dbi-services.com>)
Re: [GENERAL] Row based permissions: at DB or at Application level?  (vinny <vinny@xs4all.nl>)
List pgsql-general
I am thinking about rewriting an existing application which uses PostgreSQL via Django (ORM and Web-Framework written
in 
Python).

Up to now the permission checks are done at the application level.

Up to now queries like: "Show all items which the current user is allowed to modify" result in complicated SQL and
this leads to slow queries.

Up to now there is one db-user and the application does the filtering of rows to prevent application users to see
items which they are not allowed to see.

I guess most web applications work like this.

I would like to reduce the "ifing and elsing" in my python code (less conditions, less bugs, more SQL, more
performance)

How could an application which gets written from scratch use PostgreSQL to implement
row based permissions?

Regards,
   Thomas Güttler

--
Thomas Guettler http://www.thomas-guettler.de/


pgsql-general by date:

Previous
From: Adam Šlachta
Date:
Subject: [GENERAL] How to get transaction started always in WRITE mode.
Next
From: Daniel Westermann
Date:
Subject: Re: [GENERAL] Row based permissions: at DB or at Application level?