row based security ... was Different views with same name for different users

From: "Harald Massa" <HaraldMassa(at)ghum(dot)de>
To: "Postgres Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: row based security ... was Different views with same name for different users
Date: 2002-01-20 21:26:34
Message-ID: 015a01c1a1f9$2dc1aa80$0100a8c0@tog2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have other words for my question, maybe they are more helpfull.

What I'm looking for is ROW BASED SECURITY.

That means:

User A is allowed to look and update some rows
User B is allowed to look and update some other rows

Example: User A is only allowed to edit customers from the USA, User B is
allowed to edit customers from Europa.

My solution is:
one field (beraterid) in the table, and a view like

create view pers as select * from totaldatabase
where case currentuser="userA" then beraterid in (1256,2523,2521,623,124)
else beraterid in (9123, 12312,12313) end

some pain is connected. BUT I strongly beliefe, there must be a simpler,
more elegant solution.

What is it?

Thanl you very much in advance

HArald

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-01-20 21:36:04 Re: PL/pgSQL: dynamic tablename
Previous Message Harald Massa 2002-01-20 21:16:09 Re: Different views with same name for different users