mirror of
https://github.com/postgres/postgres.git
synced 2025-09-05 02:22:28 +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:
@@ -635,7 +635,7 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
|
||||
|
||||
/* must be owner */
|
||||
if (!pg_subscription_ownercheck(HeapTupleGetOid(tup), GetUserId()))
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_SUBSCRIPTION,
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_SUBSCRIPTION,
|
||||
stmt->subname);
|
||||
|
||||
subid = HeapTupleGetOid(tup);
|
||||
@@ -854,7 +854,7 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel)
|
||||
|
||||
/* must be owner */
|
||||
if (!pg_subscription_ownercheck(subid, GetUserId()))
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_SUBSCRIPTION,
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_SUBSCRIPTION,
|
||||
stmt->subname);
|
||||
|
||||
/* DROP hook for the subscription being removed */
|
||||
@@ -1022,7 +1022,7 @@ AlterSubscriptionOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
|
||||
return;
|
||||
|
||||
if (!pg_subscription_ownercheck(HeapTupleGetOid(tup), GetUserId()))
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_SUBSCRIPTION,
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_SUBSCRIPTION,
|
||||
NameStr(form->subname));
|
||||
|
||||
/* New owner must be a superuser */
|
||||
|
Reference in New Issue
Block a user