!5724 【内核】闪回purge recyclebin操作权限修改

Merge pull request !5724 from 孙德超/bugfix4
This commit is contained in:
opengauss_bot
2024-07-23 11:46:15 +00:00
committed by Gitee

View File

@ -32407,6 +32407,15 @@ void ExecutePurge(PurgeStmt *stmt)
break;
}
case PURGE_RECYCLEBIN: {
Oid userId = GetUserId();
/*
* Superusers bypass all permission checking.
* Database Security: Support seperation of privilege.
*/
if (!(superuser_arg(userId) || systemDBA_arg(userId))) {
ereport(ERROR,
(errmsg("Only superuser can do purge recyclebin operation.")));
}
RbCltPurgeRecyclebin();
break;
}