From: | kobolds <dreammes2007(at)gmail(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | about view privileges |
Date: | 2013-04-10 12:41:31 |
Message-ID: | 1365597691780-5751603.post@n5.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hi,
I playing around with view privileges ,
- I create 2 users (user1 and user2)
- drop schema public;
- create table sh1.tb1 (emp_no integer , emp_name varchar(50)) ;
- insert some records into sh1.tb1
- revoke all privileges on table sh1.tb1 from public;
- grant all privileges on all tables in schema sh1 to user1;
- /create view sh1.vw1 as select * from sh1.tb1;/
- /revoke all privileges on sh1.vw1 from public;/
- /grant select on sh1.vw1 to user1;/
as you can see I only grant access to user1 and not user2
from user2 i execute
db1=> /select * from sh1.tb1;/
ERROR: permission denied for relation tb1
this is correct
- /create view sh1.vw2 as select * from sh1.vw1;/
- /revoke all privileges on sh1.vw2 from public;/
- /grant select on sh1.vw2 to user2;/
from user2 when i execute
/select * from sh1.vw2;/
it return records from sh1.tb1 in which user2 donot has privileges on
sh1.vw1 or sh1.tb1 ;
anyway for me to prevent this to happen?
--
View this message in context: http://postgresql.1045698.n5.nabble.com/about-view-privileges-tp5751603.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Steve Rosenberry | 2013-04-10 13:37:24 | Re: Client query hangs when network connection is lost to the server. |
Previous Message | Andrej | 2013-04-09 22:12:09 | Re: Client query hangs when network connection is lost to the server. |