mirror of
https://github.com/postgres/postgres.git
synced 2025-10-28 11:55:03 +03:00
Replace AclObjectKind with ObjectType
AclObjectKind was basically just another enumeration for object types, and we already have a preferred one for that. It's only used in aclcheck_error. By using ObjectType instead, we can also give some more precise error messages, for example "index" instead of "relation". Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
@@ -955,7 +955,7 @@ ExecInitExprRec(Expr *node, ExprState *state,
|
||||
GetUserId(),
|
||||
ACL_EXECUTE);
|
||||
if (aclresult != ACLCHECK_OK)
|
||||
aclcheck_error(aclresult, ACL_KIND_PROC,
|
||||
aclcheck_error(aclresult, OBJECT_FUNCTION,
|
||||
get_func_name(opexpr->opfuncid));
|
||||
InvokeFunctionExecuteHook(opexpr->opfuncid);
|
||||
|
||||
@@ -2162,7 +2162,7 @@ ExecInitFunc(ExprEvalStep *scratch, Expr *node, List *args, Oid funcid,
|
||||
/* Check permission to call function */
|
||||
aclresult = pg_proc_aclcheck(funcid, GetUserId(), ACL_EXECUTE);
|
||||
if (aclresult != ACLCHECK_OK)
|
||||
aclcheck_error(aclresult, ACL_KIND_PROC, get_func_name(funcid));
|
||||
aclcheck_error(aclresult, OBJECT_FUNCTION, get_func_name(funcid));
|
||||
InvokeFunctionExecuteHook(funcid);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user