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.
danq9
signup: the person chooses the password and name on the confirm page
83c7aa6
2 weeks, 5 days ago
History
rules.json · 1.7 KB · 34 lines
| 1 | { |
| 2 | "rules": [ |
| 3 | { |
| 4 | "effect": "allow", |
| 5 | "principal": "registered", |
| 6 | "actions": ["create", "read", "update"], |
| 7 | "collection": "receipts", |
| 8 | "row_filter": {"owner_id": "$user_id"}, |
| 9 | "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" |
| 10 | }, |
| 11 | { |
| 12 | "effect": "allow", |
| 13 | "principal": "registered", |
| 14 | "actions": ["create", "read", "update"], |
| 15 | "collection": "receipt_lines", |
| 16 | "row_filter": {"owner_id": "$user_id"}, |
| 17 | "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" |
| 18 | }, |
| 19 | { |
| 20 | "effect": "allow", |
| 21 | "principal": "registered", |
| 22 | "actions": ["execute"], |
| 23 | "object_id": "action_receive_goods", |
| 24 | "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" |
| 25 | }, |
| 26 | { |
| 27 | "effect": "allow", |
| 28 | "principal": "registered", |
| 29 | "actions": ["execute"], |
| 30 | "object_id": "site_receiving_sheet", |
| 31 | "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" |
| 32 | } |
| 33 | ] |
| 34 | } |