mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
First step done,
below is the patch to have views to override the permission checks for the accessed tables. Now we can do the following: CREATE VIEW db_user AS SELECT usename, usesysid, usecreatedb, usetrace, usecatupd, '**********'::text as passwd, valuntil FROM pg_user; REVOKE ALL ON pg_user FROM public; REVOKE ALL ON db_user FROM public; GRANT SELECT ON db_user TO public;
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.42 1998/02/13 03:26:38 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.43 1998/02/21 06:31:37 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -299,6 +299,17 @@ ExecCheckPerms(CmdType operation,
|
||||
{
|
||||
RangeTblEntry *rte = lfirst(lp);
|
||||
|
||||
if (rte->skipAcl)
|
||||
{
|
||||
/*
|
||||
* This happens if the access to this table is due
|
||||
* to a view query rewriting - the rewrite handler
|
||||
* checked the permissions against the view owner,
|
||||
* so we just skip this entry.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
relid = rte->relid;
|
||||
htp = SearchSysCacheTuple(RELOID,
|
||||
ObjectIdGetDatum(relid),
|
||||
|
Reference in New Issue
Block a user