Skip to content

Commit 5856fb0

Browse files
committed
fix(rest): put each registrar's docblock back on its own method; declare Clause-② yes (narrowing)
The user-work registrar had been inserted between the security-explain registrar's docblock and its body, so each method carried the other's docblock. It now sits after registerSecurityExplainEndpoints, and the diff against main is a pure addition. The changeset declares Clause-②: yes (narrowing): the published FieldErrorCode enum gains a member, which widens the public face. Claude-Session: https://claude.ai/code/session_01Utp6CZavYYLh5k5r6jhgCF Co-authored-by: Claude <noreply@anthropic.com>
1 parent d5d8874 commit 5856fb0

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎.changeset/30205-banned-user-work-handover.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
feat(objectql,rest)!: a new assignment to a banned user is refused, and a banned user's records can be counted and handed over in bulk (#30205)
1010

11-
Clause-②: no (narrowing) — a non-system create or update that sets a user field (the owner field, a `user` field, or a `lookup` to `sys_user`) to a user whose ban is in force is refused `400 VALIDATION_FAILED` with the field code `reference_user_banned`, a write that answered `201` / `200` before. A value the row already stores is not judged, so a record that already holds the banned user stays editable. The two new routes and SDK methods are additions.
11+
Clause-②: yes (narrowing) — the published `FieldErrorCode` enum gains the member `reference_user_banned`. A non-system create or update that sets a user field (the owner field, a `user` field, or a `lookup` to `sys_user`) to a user whose ban is in force is refused `400 VALIDATION_FAILED` with that field code, a write that answered `201` / `200` before. A value the row already stores is not judged, so a record that already holds the banned user stays editable. The two new routes and SDK methods are additions.
1212
Metadata-protocol: none
1313
Skills-docs: no move in `skills/**`, which teaches no user-assignment verdict; `content/docs/permissions/administrator-guide.mdx` gains "Handing over a banned user's work" and its offboarding quick path points at it.
1414

‎packages/rest/src/rest-server.ts‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6181,19 +6181,20 @@ export class RestServer {
61816181
* business) and returns 501 when no security service exposing `explain`
61826182
* is mounted (a deployment without `@objectstack/plugin-security`).
61836183
*/
6184-
private registerUserWorkEndpoints(basePath: string): void {
6185-
// [#30205] The body lives in `user-work-routes.ts`. This literal hands it
6186-
// every member it reads (see `UserWorkRouteHost`); the engine provider
6187-
// FIELD goes as a getter, read when a handler reads it.
6188-
const readObjectQLProvider = () => this.objectQLProvider;
6189-
const host: UserWorkRouteHost = {
6184+
private registerSecurityExplainEndpoints(basePath: string): void {
6185+
// [#23050 slice 6] The body moved to `security-routes.ts`. This literal
6186+
// hands it every member it reads — the list IS its dependency on this
6187+
// class (see `SecurityExplainRouteHost`, and that module's header for why
6188+
// `securityServiceProvider` is a getter).
6189+
const readSecurityServiceProvider = () => this.securityServiceProvider;
6190+
const host: SecurityExplainRouteHost = {
61906191
routeManager: this.routeManager,
6191-
get objectQLProvider() { return readObjectQLProvider(); },
6192+
get securityServiceProvider() { return readSecurityServiceProvider(); },
61926193
resolveRequestEnvironmentId: (...a) => this.resolveRequestEnvironmentId(...a),
61936194
resolveExecCtx: (...a) => this.resolveExecCtx(...a),
61946195
enforceAuth: (...a) => this.enforceAuth(...a),
61956196
};
6196-
registerUserWorkEndpoints.call(host, basePath);
6197+
registerSecurityExplainEndpoints.call(host, basePath);
61976198
}
61986199

61996200
/**
@@ -6210,20 +6211,19 @@ export class RestServer {
62106211
* Neither touches the ban. `@objectstack/core`'s `user-assigned-work.ts`
62116212
* holds the rules.
62126213
*/
6213-
private registerSecurityExplainEndpoints(basePath: string): void {
6214-
// [#23050 slice 6] The body moved to `security-routes.ts`. This literal
6215-
// hands it every member it reads — the list IS its dependency on this
6216-
// class (see `SecurityExplainRouteHost`, and that module's header for why
6217-
// `securityServiceProvider` is a getter).
6218-
const readSecurityServiceProvider = () => this.securityServiceProvider;
6219-
const host: SecurityExplainRouteHost = {
6214+
private registerUserWorkEndpoints(basePath: string): void {
6215+
// [#30205] The body lives in `user-work-routes.ts`. This literal hands it
6216+
// every member it reads (see `UserWorkRouteHost`); the engine provider
6217+
// FIELD goes as a getter, read when a handler reads it.
6218+
const readObjectQLProvider = () => this.objectQLProvider;
6219+
const host: UserWorkRouteHost = {
62206220
routeManager: this.routeManager,
6221-
get securityServiceProvider() { return readSecurityServiceProvider(); },
6221+
get objectQLProvider() { return readObjectQLProvider(); },
62226222
resolveRequestEnvironmentId: (...a) => this.resolveRequestEnvironmentId(...a),
62236223
resolveExecCtx: (...a) => this.resolveExecCtx(...a),
62246224
enforceAuth: (...a) => this.enforceAuth(...a),
62256225
};
6226-
registerSecurityExplainEndpoints.call(host, basePath);
6226+
registerUserWorkEndpoints.call(host, basePath);
62276227
}
62286228

62296229
/**

0 commit comments

Comments
 (0)