mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Restructure aclcheck error reporting to make permission-failure
messages more uniform and internationalizable: the global array aclcheck_error_strings[] is gone in favor of a subroutine aclcheck_error(). Partial implementation of namespace-related permission checks --- not all done yet.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.68 2002/04/19 23:13:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.69 2002/04/27 03:45:03 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -127,7 +127,7 @@ DefineQueryRewrite(RuleStmt *stmt)
|
||||
*event_qualP;
|
||||
List *l;
|
||||
Query *query;
|
||||
int32 aclcheck_result;
|
||||
AclResult aclresult;
|
||||
bool RelisBecomingView = false;
|
||||
|
||||
/*
|
||||
@@ -144,11 +144,9 @@ DefineQueryRewrite(RuleStmt *stmt)
|
||||
/*
|
||||
* Check user has permission to apply rules to this relation.
|
||||
*/
|
||||
aclcheck_result = pg_class_aclcheck(ev_relid, GetUserId(), ACL_RULE);
|
||||
if (aclcheck_result != ACLCHECK_OK)
|
||||
elog(ERROR, "%s: %s",
|
||||
RelationGetRelationName(event_relation),
|
||||
aclcheck_error_strings[aclcheck_result]);
|
||||
aclresult = pg_class_aclcheck(ev_relid, GetUserId(), ACL_RULE);
|
||||
if (aclresult != ACLCHECK_OK)
|
||||
aclcheck_error(aclresult, RelationGetRelationName(event_relation));
|
||||
|
||||
/*
|
||||
* No rule actions that modify OLD or NEW
|
||||
|
||||
Reference in New Issue
Block a user