Repository navigation
Commit 48d3d2b
committed
docs(skills): gate the usePermissions example on can(), a boolean, and mark its fence
The `usePermissions` hook example in `skills/objectui/guides/auth-permissions.md`
gated two buttons on `check('contacts', 'update', contact)`. `check` answers a
`PermissionCheckResult` object, an object is truthy, and so both buttons rendered
for every user, denied ones included. The fence was unmarked, so
`check-skill-examples` never compiled it.
The example now gates on `can('contacts', 'update')` / `can('contacts', 'delete')`
— the one boolean spelling the guide's neighbouring paragraph already publishes —
annotated `: boolean` so a `check(...)` put back in that position fails to compile.
The record argument is dropped: measured against the built `@object-ui/permissions`
dist with a throwing Proxy as the record, `evaluatePermission` performs zero
property reads on it, and `can()` agrees with `check(..., record).allowed` on every
(role, action) of the guide's own config.
The fence carries the `os:check` marker and is tagged `tsx`, imports `Button`
from `@object-ui/components`, and types `contact` inline, so the gate compiles
it against the built dist from now on (Semantic phase: 16 of 16 ts fences).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W5y9kRg1YtYaMQYExVLRc21 parent edbcf1e commit 48d3d2b
1 file changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
| 225 | + | |
225 | 226 | | |
| 227 | + | |
226 | 228 | | |
227 | | - | |
228 | | - | |
| 229 | + | |
| 230 | + | |
229 | 231 | | |
230 | | - | |
231 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
| |||
0 commit comments