Row Level Access

Started by Maciej Mrowiecover 12 years ago2 messagesgeneral
Jump to latest
#1Maciej Mrowiec
maciej.mrowiec@cfengine.com

Hello List :D

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

Cheers,
Maciek

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Maciej Mrowiec (#1)
Re: Row Level Access

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

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