aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/user.c')
-rw-r--r--src/backend/commands/user.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 9a88c907894..2edbabe7549 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -425,7 +425,8 @@ CreateRole(CreateRoleStmt *stmt)
GetUserId(), false);
/* Post creation hook for new role */
- InvokeObjectAccessHook(OAT_POST_CREATE, AuthIdRelationId, roleid, 0);
+ InvokeObjectAccessHook(OAT_POST_CREATE,
+ AuthIdRelationId, roleid, 0, NULL);
/*
* Close pg_authid, but keep lock till commit.
@@ -932,6 +933,15 @@ DropRole(DropRoleStmt *stmt)
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must be superuser to drop superusers")));
+ /* DROP hook for the role being removed */
+ if (object_access_hook)
+ {
+ ObjectAccessDrop drop_arg;
+ memset(&drop_arg, 0, sizeof(ObjectAccessDrop));
+ InvokeObjectAccessHook(OAT_DROP,
+ AuthIdRelationId, roleid, 0, &drop_arg);
+ }
+
/*
* Lock the role, so nobody can add dependencies to her while we drop
* her. We keep the lock until the end of transaction.