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 · 3.5 KB · 62 lines
| 1 | { |
| 2 | "rules": [ |
| 3 | { |
| 4 | "effect": "allow", |
| 5 | "principal": "registered", |
| 6 | "actions": ["create", "read", "update"], |
| 7 | "collection": "shipments", |
| 8 | "row_filter": {"owner_id": "$user_id"}, |
| 9 | "reason": "a shipment is the operator's own paperwork about their own goods; no delete, because a parcel that went out cannot be made not to have gone out -- a mistake is a lost/returned status or an inbound shipment, never a vanished row" |
| 10 | }, |
| 11 | { |
| 12 | "effect": "allow", |
| 13 | "principal": "registered", |
| 14 | "actions": ["create", "read", "update"], |
| 15 | "collection": "shipment_lines", |
| 16 | "row_filter": {"owner_id": "$user_id"}, |
| 17 | "reason": "the lines are the shipment; same scope and the same no-delete posture, and the over-shipping gate in hook_shipment_lines runs on this path whoever the caller is" |
| 18 | }, |
| 19 | { |
| 20 | "effect": "allow", |
| 21 | "principal": "registered", |
| 22 | "actions": ["execute"], |
| 23 | "object_id": "action_create_shipment", |
| 24 | "reason": "packing is warehouse work, not owner-only work: anybody signed in can raise a shipment, and everything they can put in it is bounded by what the order already committed to" |
| 25 | }, |
| 26 | { |
| 27 | "effect": "allow", |
| 28 | "principal": "registered", |
| 29 | "actions": ["execute"], |
| 30 | "object_id": "site_packing_slip", |
| 31 | "reason": "operator-facing, deliberately NOT public: the slip is addressed by an internal shipment id, so a public page here would be an enumeration oracle for every parcel in the shop. The customer's door is the payment portal's capability token, which is unguessable and revocable; a slip is printed by the person holding the box" |
| 32 | }, |
| 33 | { |
| 34 | "effect": "allow", |
| 35 | "principal": "registered", |
| 36 | "actions": ["execute"], |
| 37 | "object_id": "site_pick_list", |
| 38 | "reason": "the picker has to be signed in for the page to know whose warehouse to fold; the page itself shows a sign-in prompt rather than an error to anyone who is not" |
| 39 | }, |
| 40 | { |
| 41 | "effect": "allow", |
| 42 | "principal": "registered", |
| 43 | "actions": ["execute"], |
| 44 | "object_id": "site_manifest", |
| 45 | "reason": "same gate as the pick list and for the same reason: the page folds the signed-in operator's own dock, and it shows a sign-in prompt rather than an error to anybody else. Deliberately not public even though a driver reads it -- the paper in their hand is the copy they get, and a public URL listing every parcel, its destination and its tracking number would be a delivery-route map for anyone who guessed the date" |
| 46 | }, |
| 47 | { |
| 48 | "effect": "allow", |
| 49 | "principal": "registered", |
| 50 | "actions": ["execute"], |
| 51 | "object_id": "action_buy_label", |
| 52 | "reason": "buying postage is bench work, not owner-only work, and it is bounded on every side: it writes nothing but a tracking number and a label file onto one existing shipment, it refuses a parcel whose journey is already over, and with no carrier configured it can only record what an operator typed. The money a real carrier adapter can spend is bounded by that adapter's own credentials, which a signed-in packer does not hold" |
| 53 | }, |
| 54 | { |
| 55 | "effect": "allow", |
| 56 | "principal": "registered", |
| 57 | "actions": ["execute"], |
| 58 | "object_id": "system_tracking_poll", |
| 59 | "reason": "the scheduler runs this hourly, and an operator watching a parcel should be able to poke it in between without an admin token: it only writes back what the carrier said, and the one derived move it makes (delivered) is the move the carrier just reported" |
| 60 | } |
| 61 | ] |
| 62 | } |