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.6 KB · 61 lines
| 1 | { |
| 2 | "rules": [ |
| 3 | { |
| 4 | "effect": "allow", |
| 5 | "principal": "registered", |
| 6 | "actions": [ |
| 7 | "create", |
| 8 | "read", |
| 9 | "update", |
| 10 | "delete" |
| 11 | ], |
| 12 | "collection": "payments", |
| 13 | "row_filter": { |
| 14 | "owner_id": "$user_id" |
| 15 | }, |
| 16 | "reason": "signed-in users manage payments they recorded" |
| 17 | }, |
| 18 | { |
| 19 | "effect": "allow", |
| 20 | "principal": "registered", |
| 21 | "actions": [ |
| 22 | "create", |
| 23 | "read", |
| 24 | "update", |
| 25 | "delete" |
| 26 | ], |
| 27 | "collection": "refunds", |
| 28 | "row_filter": { |
| 29 | "owner_id": "$user_id" |
| 30 | }, |
| 31 | "reason": "signed-in users manage refunds they recorded" |
| 32 | }, |
| 33 | { |
| 34 | "effect": "allow", |
| 35 | "principal": "public", |
| 36 | "actions": [ |
| 37 | "execute" |
| 38 | ], |
| 39 | "object_id": "site_payments", |
| 40 | "reason": "the payments page is a public static shell; data stays row-gated" |
| 41 | }, |
| 42 | { |
| 43 | "effect": "allow", |
| 44 | "principal": "public", |
| 45 | "actions": [ |
| 46 | "execute" |
| 47 | ], |
| 48 | "object_id": "webhook_stripe", |
| 49 | "reason": "Stripe is not a user of this server and cannot hold a credential: authenticity comes from the HMAC signature the object verifies over the raw body, which is why the endpoint must be publicly reachable and the object must fail closed" |
| 50 | }, |
| 51 | { |
| 52 | "effect": "allow", |
| 53 | "principal": "public", |
| 54 | "actions": [ |
| 55 | "execute" |
| 56 | ], |
| 57 | "object_id": "action_stripe_checkout", |
| 58 | "reason": "the payer has no account here; possession of the unguessable portal token IS the authorization, same as viewing the invoice, and the amount is computed server-side from the open balance" |
| 59 | } |
| 60 | ] |
| 61 | } |