Re: Row Level Access

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Maciej Mrowiec *EXTERN*" <maciej(dot)mrowiec(at)cfengine(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Row Level Access
Date: 2013-11-06 10:28:35
Message-ID: A737B7A37273E048B164557ADEF4A58B17C56EEE@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Maciej Mrowiec wrote:
> I'm working on RBAC implementation over posgresql and I was wondering is there any common technique to
> achieve row level access control ?
>
> So far I'm considering using WITH clause in template like this:
>
> WITH <table_name> AS ( SELECT ..... ) <user_query>;
>
> Which would be just prepended to any specified query.
>
> I'm fairly new to posgresql, recently I was mostly working with mongodb. So I would be glad to get
> some tips :D

I am not sure if I understand your problem correctly,
but if you want to restrict a query to a subset of rows,
You might be better off with a view that has the
security_barrier option set.

That allows the planner to come up with a better plan.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2013-11-06 12:03:05 Re: pg_start_backup('label',true) why do I need 2nd parameter?
Previous Message johannes graën 2013-11-06 10:08:05 Some questions about postgresql's default text search parser