@suluk/hono 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/access.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suluk/hono",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "The Suluk derivation engine: minimal Hono+Zod RouteContracts in; v4 doc (dynamic per principal+time), validation, contract tests, and doc-coverage audit out. CANDIDATE tooling.",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/access.ts CHANGED
@@ -57,7 +57,7 @@ export function gate(rule: Rule, id: GateIdentity): GateDecision {
57
57
  return { ok: true, scopeOwner: true }; // signed-in: scoped to own rows
58
58
  case "admin":
59
59
  if (!id.principal) return { ok: false, scopeOwner: false, status: 401 }; // authenticate first (RFC 7235)
60
- return { ok: id.isAdmin, scopeOwner: false, status: 403 }; // signed-in but not admin → forbidden
60
+ return id.isAdmin ? { ok: true, scopeOwner: false } : { ok: false, scopeOwner: false, status: 403 }; // signed-in non-admin → 403
61
61
  default: return { ok: false, scopeOwner: false, status: 403 };
62
62
  }
63
63
  }