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.5 KB · 54 lines
| 1 | { |
| 2 | "rules": [ |
| 3 | { |
| 4 | "effect": "allow", |
| 5 | "principal": "registered", |
| 6 | "actions": [ |
| 7 | "create", |
| 8 | "read", |
| 9 | "update" |
| 10 | ], |
| 11 | "collection": "scans", |
| 12 | "row_filter": { |
| 13 | "owner_id": "$user_id" |
| 14 | }, |
| 15 | "reason": "people see and manage the documents they sent in; a scan is somebody's paperwork, not the company's noticeboard" |
| 16 | }, |
| 17 | { |
| 18 | "effect": "allow", |
| 19 | "principal": "registered", |
| 20 | "actions": [ |
| 21 | "execute" |
| 22 | ], |
| 23 | "object_id": "action_scan_ingest", |
| 24 | "reason": "capture has to be available to whoever is holding the receipt, which is everybody" |
| 25 | }, |
| 26 | { |
| 27 | "effect": "allow", |
| 28 | "principal": "registered", |
| 29 | "actions": [ |
| 30 | "execute" |
| 31 | ], |
| 32 | "object_id": "action_confirm_scan", |
| 33 | "reason": "confirming creates a DRAFT expense owned by the confirmer; it still faces the approval gate, which somebody else has to pass it through" |
| 34 | }, |
| 35 | { |
| 36 | "effect": "allow", |
| 37 | "principal": "role:manager", |
| 38 | "actions": [ |
| 39 | "read" |
| 40 | ], |
| 41 | "collection": "scans", |
| 42 | "reason": "the person approving an expense has to see the receipt it cites (expenses.receipt_scan_id, app-finance 0.19.0); read only, and the scan's image file stays under its owner's files" |
| 43 | }, |
| 44 | { |
| 45 | "effect": "allow", |
| 46 | "principal": "role:finance", |
| 47 | "actions": [ |
| 48 | "read" |
| 49 | ], |
| 50 | "collection": "scans", |
| 51 | "reason": "finance traces every expense on the books to its receipt for the year-end file; read only" |
| 52 | } |
| 53 | ] |
| 54 | } |