Skip site navigation (1) Skip section navigation (2)

BUG #5214: Permission troubles for views

From: "Nikolay" <wheelly(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5214: Permission troubles for views
Date: 2009-11-26 10:11:31
Message-ID: 200911261011.nAQABVIY073254@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5214
Logged by:          Nikolay
Email address:      wheelly(at)gmail(dot)com
PostgreSQL version: 8.4.1
Operating system:   Gentoo Linux
Description:        Permission troubles for views
Details: 

There is two users in database: user_a and user_b.
user_a is an owner of current schema.

Table "tbl_data":
ALTER TABLE "tbl_data" OWNER TO user_a;
REVOKE SELECT, INSERT, UPDATE, DELETE ON TABLE "tbl_data" FROM user_a;
GRANT REFERENCES, TRIGGER ON TABLE "tbl_data" TO user_a;
GRANT ALL ON TABLE "tbl_data" TO user_b;

Execute query as user_a:
SELECT * FROM "tbl_data"; - permission denied for relation tbl_data. 
This is correct. user_a can't select from  table tbl_data.

Execute query as user_b:
SELECT * FROM "tbl_data"; - returns rows from table.
This is correct. user_b can select from table tbl_data.

View "vw_data":
CREATE VIEW "vw_data" as select * from "tbl_data";
ALTER TABLE "vw_data" OWNER TO user_a;
REVOKE SELECT, INSERT, UPDATE, DELETE ON TABLE "vw_data" FROM user_a;
GRANT ALL ON TABLE "vw_data" TO user_b;

Execute query as user_a:
SELECT * FROM "vw_data"; - permission denied for relation vw_data. This is
correct. 

Execute query as user_b:
SELECT * FROM "vw_data"; - permission denied for relation tbl_data. But
permissions say that user_b can select from tbl_data and from vw_data.

Responses

pgsql-bugs by date

Next:From: Walter WillmertingerDate: 2009-11-26 10:41:23
Subject: BUG #5215: Error in PgAdmin
Previous:From: Robert HaasDate: 2009-11-25 20:39:32
Subject: Re: BUG #5210: error in intidb process when installing on japanese

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group