mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Improve reporting of permission errors for array types
Because permissions are assigned to element types, not array types, complaining about permission denied on an array type would be misleading to users. So adjust the reporting to refer to the element type instead. In order not to duplicate the required logic in two dozen places, refactor the permission denied reporting for types a bit. pointed out by Yeb Havinga during the review of the type privilege feature
This commit is contained in:
@@ -302,6 +302,8 @@ extern void aclcheck_error(AclResult aclerr, AclObjectKind objectkind,
|
||||
extern void aclcheck_error_col(AclResult aclerr, AclObjectKind objectkind,
|
||||
const char *objectname, const char *colname);
|
||||
|
||||
extern void aclcheck_error_type(AclResult aclerr, Oid typeOid);
|
||||
|
||||
/* ownercheck routines just return true (owner) or false (not) */
|
||||
extern bool pg_class_ownercheck(Oid class_oid, Oid roleid);
|
||||
extern bool pg_type_ownercheck(Oid type_oid, Oid roleid);
|
||||
|
||||
Reference in New Issue
Block a user