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 · 2.5 KB · 36 lines
| 1 | { |
| 2 | "rules": [ |
| 3 | {"effect": "deny", "principal": "owner_fallback", "actions": ["delete"], "collection": "receipts", "reason": "a delivery that arrived cannot be made not to have arrived: no delete. 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"}, |
| 4 | {"effect": "deny", "principal": "owner_fallback", "actions": ["delete"], "collection": "receipt_lines", "reason": "the lines are the receipt: no delete. 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"}, |
| 5 | { |
| 6 | "effect": "allow", |
| 7 | "principal": "registered", |
| 8 | "actions": ["create", "read", "update"], |
| 9 | "collection": "receipts", |
| 10 | "row_filter": {"owner_id": "$user_id"}, |
| 11 | "reason": "a receipt is the operator's own paperwork about their own goods; no delete, because a delivery that arrived cannot be made not to have arrived -- a mistake is a cancelled receipt or an adjustment move, never a vanished row" |
| 12 | }, |
| 13 | { |
| 14 | "effect": "allow", |
| 15 | "principal": "registered", |
| 16 | "actions": ["create", "read", "update"], |
| 17 | "collection": "receipt_lines", |
| 18 | "row_filter": {"owner_id": "$user_id"}, |
| 19 | "reason": "the lines are the receipt; same scope and the same no-delete posture, and the over-receiving gate in hook_receipt_lines runs on this path whoever the caller is" |
| 20 | }, |
| 21 | { |
| 22 | "effect": "allow", |
| 23 | "principal": "registered", |
| 24 | "actions": ["execute"], |
| 25 | "object_id": "action_receive_goods", |
| 26 | "reason": "checking a delivery in is warehouse work, not owner-only work: anybody signed in can book a pallet in, and everything they can put on it is bounded by what the purchase order already committed to" |
| 27 | }, |
| 28 | { |
| 29 | "effect": "allow", |
| 30 | "principal": "registered", |
| 31 | "actions": ["execute"], |
| 32 | "object_id": "site_receiving_sheet", |
| 33 | "reason": "the receiver has to be signed in for the page to know whose warehouse to fold, and the sheet names a supplier and everything we buy from them -- deliberately NOT public, because a page addressed by an internal order id would be an enumeration oracle for the whole purchase ledger; the page itself shows a sign-in prompt rather than an error to anyone who is not" |
| 34 | } |
| 35 | ] |
| 36 | } |