askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
rules.json · 3.6 KB · 44 lines
| 1 | { |
| 2 | "retracted": [ |
| 3 | {"effect": "allow", "principal": "registered", "actions": ["read"], "collection": "template_runs", "reason": "replaced by the owner-filtered read: without a row filter every signed-in user read every other user's runs (bug-reports/2026-11-28-06-14-31)"} |
| 4 | ], |
| 5 | "rules": [ |
| 6 | {"effect": "deny", "principal": "owner_fallback", "actions": ["update", "delete"], "collection": "template_runs", "reason": "a run is read-only to the person it belongs to: only the runner and the sweeper move one, in process, and action_resolve_run is the owner's one door. The read rule below has always said that the absence of an update grant enforces this; it did not. No rule grants this; the engine's owner fallback did, to whoever the row's owner key names. This switches the fallback off for these actions only: an explicit grant still grants, and admins and in-process writers are unaffected"}, |
| 7 | { |
| 8 | "effect": "allow", |
| 9 | "principal": "registered", |
| 10 | "actions": ["execute"], |
| 11 | "object_id": "action_run_template", |
| 12 | "reason": "registered and never public, and the reason is money: a run places a hold on a wallet and may spend real cash at a provider, so an anonymous run is an open tap. The object itself refuses a caller with no identity besides -- the grant and the check agree rather than one relying on the other" |
| 13 | }, |
| 14 | { |
| 15 | "effect": "allow", |
| 16 | "principal": "registered", |
| 17 | "actions": ["read"], |
| 18 | "collection": "template_runs", |
| 19 | "row_filter": {"owner_id": "$user_id"}, |
| 20 | "reason": "a person reads THEIR OWN runs: a run carries the stamped rendered_body and instructions of a template that may be private, the form_data somebody typed, and the output and error, so a registered read with no row filter handed every user every other user's work (bug-reports/2026-11-28-06-14-31). READ ONLY, and the absence of update is the enforcement of the state machine: the only hands that may move a run between statuses are the runner and the sweeper, in process, walking the transitions the schema declares. A person who could PUT a run from abandoned back to queued through the API would be re-running a paid, non-idempotent provider call from a form field. No create either -- action_run_template is the one door in, because a run typed by hand is a job with no hold behind it, which the runner would execute for free" |
| 21 | }, |
| 22 | { |
| 23 | "effect": "allow", |
| 24 | "principal": "registered", |
| 25 | "actions": ["execute"], |
| 26 | "object_id": "action_resolve_run", |
| 27 | "reason": "a run's owner decides their own needs_review run -- it is their money the hold is keeping down. Registered at the door because the object itself refuses anybody who is neither the run's owner nor an admin (asked of the permission engine); without this grant the default-deny made the action admin-only and its owner path dead code (bug-reports/2026-11-28-06-14-44)" |
| 28 | }, |
| 29 | { |
| 30 | "effect": "allow", |
| 31 | "principal": "role:admin", |
| 32 | "actions": ["execute"], |
| 33 | "object_id": "system_template_runner", |
| 34 | "reason": "the minutely schedule is how this normally runs; the manual grant exists for draining a queue NOW rather than in sixty seconds. Admin rather than registered because a pass makes outbound provider calls that cost money, and who spends this server's provider budget is an operator decision" |
| 35 | }, |
| 36 | { |
| 37 | "effect": "allow", |
| 38 | "principal": "role:admin", |
| 39 | "actions": ["execute"], |
| 40 | "object_id": "system_run_sweeper", |
| 41 | "reason": "same posture as the runner: scheduled normally, executable by hand when an operator is staring at a stuck run and does not want to wait ten minutes for the sweep to notice" |
| 42 | } |
| 43 | ] |
| 44 | } |