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.