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 · 1.2 KB · 13 lines
| 1 | { |
| 2 | "rules": [ |
| 3 | {"effect": "deny", "principal": "owner_fallback", "actions": ["update", "delete"], "collection": "record_shares", "reason": "grants are written only by the owner-checked /api/share endpoint; a grant names its grantee in user_id, which the fallback read as ownership. 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": "allow", "principal": "registered", "actions": ["read"], "collection": "record_shares", |
| 5 | "row_filter": {"granted_by": "$user_id"}, |
| 6 | "reason": "a granter can list the grants they made (the Share widget's roster)"}, |
| 7 | {"effect": "allow", "principal": "registered", "actions": ["read"], "collection": "record_shares", |
| 8 | "row_filter": {"user_id": "$user_id"}, |
| 9 | "reason": "a grantee can see grants made to them"}, |
| 10 | {"effect": "allow", "principal": "public", "actions": ["execute"], "object_id": "site_share", |
| 11 | "reason": "the share widget is a public static script (like site_list); grants are still written only by the owner-checked /api/share endpoint"} |
| 12 | ] |
| 13 | } |