Skip to content

Commit bf3e9fe

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-28829-pair-added-locale
2 parents e9c3b06 + 839aae5 commit bf3e9fe

5 files changed

Lines changed: 17 additions & 5 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/core': patch
3+
---
4+
5+
docs(core): the README's `evaluateExpression` example gates on `user.isPlatformAdmin`, not `user.role === "admin"` (objectstack#28812)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The example taught `${user.role === "admin"}` as the admin check. `user.role` is better-auth's legacy `sys_user.role` scalar: ObjectStack never writes it, and with the admin plugin on it reads `user` for every user, a platform admin included, so a predicate copied from the example never opens for the people it means. The example now evaluates `${user.isPlatformAdmin === true}`, the documented platform-admin signal (`current_user.isPlatformAdmin == true`, ADR-0068 D4). No code, export or behaviour changes.

‎ui/docs/design/console-architecture.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Navigation items can be conditionally hidden using expressions:
129129
{
130130
"type": "object",
131131
"objectName": "admin_settings",
132-
"visible": "${user.role === 'admin'}"
132+
"visible": "${current_user.isPlatformAdmin === true}"
133133
}
134134
```
135135

‎ui/packages/app-shell/src/providers/ExpressionProvider.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,9 @@ function reportAppShellVisibleFault(
547547
* Supports:
548548
* - boolean: true/false
549549
* - string "true"/"false"
550-
* - template expression: "${user.role === 'admin'}"
550+
* - template expression: "${current_user.isPlatformAdmin === true}" (the
551+
* platform-admin gate; never `user.role`, better-auth's legacy scalar that
552+
* reads `'user'` for a platform admin too)
551553
* - `{ dialect: 'cel', source }` envelopes — the shape the spec's
552554
* `ExpressionInputSchema` normalizes every authored `visible` string into,
553555
* which is what nav/area items carry after the server serves the app schema

‎ui/packages/core/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ argument, and `getMeta()` — not `get()` — reads that metadata back.
6868
```typescript
6969
import { evaluateExpression } from '@object-ui/core'
7070

71-
const isAdmin = evaluateExpression('${user.role === "admin"}', {
72-
user: { name: 'John', role: 'admin' },
71+
const isPlatformAdmin = evaluateExpression('${user.isPlatformAdmin === true}', {
72+
user: { name: 'John', isPlatformAdmin: true },
7373
}) // true
7474
```
7575

‎ui/packages/core/src/actions/ActionRunner.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ export interface ActionParamDef {
932932
* (#2358 trap 1). `@objectstack/spec` documents the canonical CEL identity
933933
* scope as `os.user.*` (server formula / validation / sharing), while client
934934
* contexts historically only bound `user`. Deriving the alias here means an
935-
* action `visible` predicate authored as `os.user.role == "admin"` evaluates
935+
* action `visible` predicate authored as `os.user.isPlatformAdmin == true` evaluates
936936
* identically on client and server instead of throwing (and being fail-closed
937937
* hidden). `os.user` always tracks `context.user`; other consumer-provided
938938
* keys under `os` are preserved.

0 commit comments

Comments
 (0)