Permission to Select

Поиск
Список
Период
Сортировка
От Eugene E.
Тема Permission to Select
Дата
Msg-id 441540AA.3090202@bankir.ru
обсуждение исходный текст
Ответ на Re: REINDEX DATABASE  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Ответы Constraint Error effect on PostgreSQL  ("Christian Paul B. Cosinas" <cpc@cybees.com>)
Re: Permission to Select  (Rod Taylor <pg@rbt.ca>)
Re: Permission to Select  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hi all
the serious problem with permissions is encountered

NOTE: the following example is really useful but there is no room to 
describe it's use.


db=# CREATE USER u;
db=# CREATE TABLE t (i int, a text);
db=# REVOKE all ON t FROM u;
db=# GRANT update,insert,delete ON t TO u;
db=# \c - u

db=> INSERT INTO t VALUES (1,'x');
INSERT
db=> UPDATE t SET a='y' WHERE i=1;
ERROR: Permission denied for relation t;
db=> UPDATE t SET a='y';
UPDATE

1) The user "u" is permitted but unable to perfom the operation !
2) A user is able to update WHOLE table but unable to update ANY part of 
it !


Please examine the following patch and make your judgment:

--- src/backend/executor/execMain.c.orig 2005-11-22 1:23:08.000000000 +0300
+++ src/backend/executor/execMain.c 2006-02-17 13:19:29.000000000 +0300
@@ -460,6 +460,16 @@
bool            do_select_into;
TupleDesc       tupType;

+       if ( operation == CMD_UPDATE || operation == CMD_DELETE )
+       {
+               ListCell   *l;
+               foreach(l, parseTree->rtable)
+               {
+                       RangeTblEntry *rte = lfirst(l);
+                       rte->requiredPerms ^= ACL_SELECT;
+               }
+       }
+
/*
* Do permissions checks.  It's sufficient to examine the query's top
* rangetable here --- subplan RTEs will be checked during




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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Question re: relational technique
Следующее
От: "Christian Paul B. Cosinas"
Дата:
Сообщение: Constraint Error effect on PostgreSQL