M12 / ST-1110: Demo gebruiker read-only (#17)
* feat(ST-1110.3): add proxy.ts demo-guard for non-GET API routes
* feat(ST-1110.3+4): demo-guard proxy + block demo in QR-pairing
- proxy.ts: gebruik unsealData ipv getIronSession (middleware-compatibel)
- pair/start: isDemo-check via cookies() guard
- pair/claim: check pairing.user.is_demo na DB-read; 403 + clearPairCookie
* feat(ST-1110.5): unify demo write-button pattern to disabled+tooltip
Convert all !isDemo && <Button> patterns to <DemoTooltip show={isDemo}>
<Button disabled={isDemo}> so demo visitors see app capabilities.
Affects: pbi-list, story-panel, story-dialog, task-list, sprint-backlog,
token-manager, product-list, activate-product-button, leave-product-button,
settings page.
* test(ST-1110.6): proxy demo-guard coverage — 403 for demo+non-GET on /api/*
* docs(ST-1110.7): document three-layer demo-readonly policy and mirror plan
This commit is contained in:
parent
8a9fb9d32b
commit
1cb5772edd
19 changed files with 413 additions and 142 deletions
|
|
@ -95,10 +95,7 @@ export default async function SettingsPage() {
|
|||
</p>
|
||||
</div>
|
||||
{!session.isDemo && (
|
||||
<Link
|
||||
href="/products/new"
|
||||
className="shrink-0 text-xs text-primary hover:underline font-medium"
|
||||
>
|
||||
<Link href="/products/new" className="shrink-0 text-xs text-primary hover:underline font-medium">
|
||||
+ Nieuw product
|
||||
</Link>
|
||||
)}
|
||||
|
|
@ -149,8 +146,8 @@ export default async function SettingsPage() {
|
|||
label="Maak actief"
|
||||
/>
|
||||
)}
|
||||
{pb.kind === 'member' && !session.isDemo && (
|
||||
<LeaveProductButton productId={pb.id} />
|
||||
{pb.kind === 'member' && (
|
||||
<LeaveProductButton productId={pb.id} isDemo={session.isDemo ?? false} />
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue