fix(page-data): grant agent role set permission
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import pg from 'pg';
|
||||
import {
|
||||
buildControlSchemaSql,
|
||||
buildEnsureCurrentUserCanSetRoleSql,
|
||||
deriveUserSpaceNames,
|
||||
provisionUserSpace,
|
||||
quotePgIdentifier,
|
||||
@@ -107,6 +108,10 @@ export function createPostgresUserDataSpaceService(options = {}) {
|
||||
await client.query('ROLLBACK');
|
||||
throw error;
|
||||
}
|
||||
} else {
|
||||
// PostgreSQL 17 grants CREATEROLE owners ADMIN but not SET by default.
|
||||
// Reconcile existing spaces before the runtime executes SET LOCAL ROLE.
|
||||
await client.query(buildEnsureCurrentUserCanSetRoleSql(names.agentRole));
|
||||
}
|
||||
provisionedUsers.add(names.userId);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user