about view privileges

Поиск
Список
Период
Сортировка
От kobolds
Тема about view privileges
Дата
Msg-id 1365597691780-5751603.post@n5.nabble.com
обсуждение исходный текст
Ответы Re: about view privileges  (Kevin Grittner <kgrittn@ymail.com>)
Список 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.


В списке pgsql-novice по дате отправления:

Предыдущее
От: Andrej
Дата:
Сообщение: Re: Client query hangs when network connection is lost to the server.
Следующее
От: Steve Rosenberry
Дата:
Сообщение: Re: Client query hangs when network connection is lost to the server.