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.9 KB · 49 lines
| 1 | { |
| 2 | "rules": [ |
| 3 | { |
| 4 | "effect": "allow", |
| 5 | "principal": "registered", |
| 6 | "actions": ["create", "read", "update", "delete"], |
| 7 | "collection": "mail_accounts", |
| 8 | "row_filter": {"owner_id": "$user_id"}, |
| 9 | "reason": "a person manages only their own mailboxes; no public read, and the password is not in the row at all (it is in the owner's write-only identity vault)" |
| 10 | }, |
| 11 | { |
| 12 | "effect": "allow", |
| 13 | "principal": "registered", |
| 14 | "actions": ["read"], |
| 15 | "collection": "mail_sync_state", |
| 16 | "row_filter": {"owner_id": "$user_id"}, |
| 17 | "reason": "the owner may see where the sync has got to; only system_mail_sync writes it, because a hand-edited cursor skips or repeats mail" |
| 18 | }, |
| 19 | { |
| 20 | "effect": "allow", |
| 21 | "principal": "registered", |
| 22 | "actions": ["read"], |
| 23 | "collection": "mail_synced_messages", |
| 24 | "row_filter": {"owner_id": "$user_id"}, |
| 25 | "reason": "the owner may read the transport facts about their own mail (list headers, folder, UID); only system_mail_sync writes them" |
| 26 | }, |
| 27 | { |
| 28 | "effect": "deny", |
| 29 | "principal": "registered", |
| 30 | "actions": ["update", "delete"], |
| 31 | "collection": "mail_sync_state", |
| 32 | "reason": "explicit, because owners may otherwise update and delete their own rows by default: a hand-edited or deleted cursor makes the next pass skip or re-download mail. The sync writes it; an admin can still repair it" |
| 33 | }, |
| 34 | { |
| 35 | "effect": "deny", |
| 36 | "principal": "registered", |
| 37 | "actions": ["update", "delete"], |
| 38 | "collection": "mail_synced_messages", |
| 39 | "reason": "explicit for the same reason: these rows are the dedupe record, and deleting one makes its message look new to the next pass" |
| 40 | }, |
| 41 | { |
| 42 | "effect": "allow", |
| 43 | "principal": "public", |
| 44 | "actions": ["execute"], |
| 45 | "object_id": "site_mail_accounts", |
| 46 | "reason": "the page shows a sign-in prompt to visitors and only the signed-in owner's own accounts to anyone else" |
| 47 | } |
| 48 | ] |
| 49 | } |