Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.

9 downloads

Install on DigitalOcean Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-object-server.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-object-server.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-object-server.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

Daniel Quellhorst Changelog for this batch. 65ef78d 3 hours, 41 minutes ago History
rules.json · 14.3 KB · 30 lines
1{
2 "retracted": [
3 {"effect": "allow", "principal": "registered", "actions": ["execute"], "object_id": "action_resolve_dispute", "reason": "resolving a dispute is staff work: action_resolve_dispute checks the caller's role itself, so every registered user holding execute on it only meant a customer reached the action to be refused, and read as a grant of the one thing the action withholds from them. Staff roles hold it instead (cashier, shift_lead, manager, owner)"}
4 ],
5 "rules": [
6 {"effect": "deny", "principal": "owner_fallback", "actions": ["delete"], "collection": "disputes", "reason": "a claim that was made cannot be made not to have been made: no delete. 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"},
7 {
8 "effect": "allow",
9 "principal": "registered",
10 "actions": ["create", "read", "update"],
11 "collection": "disputes",
12 "row_filter": {"owner_id": "$user_id"},
13 "reason": "a dispute is the operator's own record of an argument about their own goods and their own money; no delete, because a claim that was made cannot be made not to have been made -- a mistake is a withdrawn dispute or one resolved as no_action with a reason, never a vanished row, and 'we told her no on the 3rd' is the answer to the chargeback that arrives on the 20th"
14 },
15 {"effect": "allow", "principal": "role:cashier", "actions": ["execute"], "object_id": "action_resolve_dispute", "reason": "settling a claim is counter work: the person on the phone to the customer is the person who can end the call. Every staff role may run the action and close a dispute it may update as no_action; only a role that may update EVERY dispute (role:manager, role:owner) may resolve one with a refund, a replacement or store credit (object_corrections.role_grants), and the action then reads the order, its bill and its payments under its own authority and checks they belong together and to one account -- no role needs or holds a right to edit orders for this. Behind that, the credit is capped at what was paid on the order (never above its total) less refunds and other disputes' credits, hook_refunds caps a refund at what the payment can give back, and hook_disputes refuses any close that does not name a real compensating record, whoever is asking. Staff roles only: the action checks the role itself (object_corrections.staff_refusal), so a customer cannot resolve their own dispute and credit their own wallet whatever the server's enforcement setting. hook_disputes itself needs no rule of its own: a pre-write gate runs inside the write it is guarding"},
16 {"effect": "allow", "principal": "role:shift_lead", "actions": ["execute"], "object_id": "action_resolve_dispute", "reason": "settling a claim is counter work: the person on the phone to the customer is the person who can end the call. Every staff role may run the action and close a dispute it may update as no_action; only a role that may update EVERY dispute (role:manager, role:owner) may resolve one with a refund, a replacement or store credit (object_corrections.role_grants), and the action then reads the order, its bill and its payments under its own authority and checks they belong together and to one account -- no role needs or holds a right to edit orders for this. Behind that, the credit is capped at what was paid on the order (never above its total) less refunds and other disputes' credits, hook_refunds caps a refund at what the payment can give back, and hook_disputes refuses any close that does not name a real compensating record, whoever is asking. Staff roles only: the action checks the role itself (object_corrections.staff_refusal), so a customer cannot resolve their own dispute and credit their own wallet whatever the server's enforcement setting. hook_disputes itself needs no rule of its own: a pre-write gate runs inside the write it is guarding"},
17 {"effect": "allow", "principal": "role:manager", "actions": ["execute"], "object_id": "action_resolve_dispute", "reason": "settling a claim is counter work: the person on the phone to the customer is the person who can end the call. Every staff role may run the action and close a dispute it may update as no_action; only a role that may update EVERY dispute (role:manager, role:owner) may resolve one with a refund, a replacement or store credit (object_corrections.role_grants), and the action then reads the order, its bill and its payments under its own authority and checks they belong together and to one account -- no role needs or holds a right to edit orders for this. Behind that, the credit is capped at what was paid on the order (never above its total) less refunds and other disputes' credits, hook_refunds caps a refund at what the payment can give back, and hook_disputes refuses any close that does not name a real compensating record, whoever is asking. Staff roles only: the action checks the role itself (object_corrections.staff_refusal), so a customer cannot resolve their own dispute and credit their own wallet whatever the server's enforcement setting. hook_disputes itself needs no rule of its own: a pre-write gate runs inside the write it is guarding"},
18 {"effect": "allow", "principal": "role:owner", "actions": ["execute"], "object_id": "action_resolve_dispute", "reason": "settling a claim is counter work: the person on the phone to the customer is the person who can end the call. Every staff role may run the action and close a dispute it may update as no_action; only a role that may update EVERY dispute (role:manager, role:owner) may resolve one with a refund, a replacement or store credit (object_corrections.role_grants), and the action then reads the order, its bill and its payments under its own authority and checks they belong together and to one account -- no role needs or holds a right to edit orders for this. Behind that, the credit is capped at what was paid on the order (never above its total) less refunds and other disputes' credits, hook_refunds caps a refund at what the payment can give back, and hook_disputes refuses any close that does not name a real compensating record, whoever is asking. Staff roles only: the action checks the role itself (object_corrections.staff_refusal), so a customer cannot resolve their own dispute and credit their own wallet whatever the server's enforcement setting. hook_disputes itself needs no rule of its own: a pre-write gate runs inside the write it is guarding"},
19 {"effect": "allow", "principal": "role:cashier", "actions": ["read"], "collection": "disputes", "reason": "staff read the shop's disputes (complaints) whoever owns the row. Checkout files a guest sale under the shop's account (shop.owner_id) and a signed-in customer's under that customer, so the owner-scoped grant showed a cashier or a manager none of them, and the Corner Cup simulation's staff signed in as the owner to do their jobs, which attributes every act to one login. Read only: changes go through app-counter's actions (void, hand over, corrections), which keep an order and its invoice in step and record who did it and why"},
20 {"effect": "allow", "principal": "role:shift_lead", "actions": ["read"], "collection": "disputes", "reason": "staff read the shop's disputes (complaints) whoever owns the row. Checkout files a guest sale under the shop's account (shop.owner_id) and a signed-in customer's under that customer, so the owner-scoped grant showed a cashier or a manager none of them, and the Corner Cup simulation's staff signed in as the owner to do their jobs, which attributes every act to one login. Read only: changes go through app-counter's actions (void, hand over, corrections), which keep an order and its invoice in step and record who did it and why"},
21 {"effect": "allow", "principal": "role:manager", "actions": ["read"], "collection": "disputes", "reason": "staff read the shop's disputes (complaints) whoever owns the row. Checkout files a guest sale under the shop's account (shop.owner_id) and a signed-in customer's under that customer, so the owner-scoped grant showed a cashier or a manager none of them, and the Corner Cup simulation's staff signed in as the owner to do their jobs, which attributes every act to one login. Read only: changes go through app-counter's actions (void, hand over, corrections), which keep an order and its invoice in step and record who did it and why"},
22 {"effect": "allow", "principal": "role:owner", "actions": ["read"], "collection": "disputes", "reason": "staff read the shop's disputes (complaints) whoever owns the row. Checkout files a guest sale under the shop's account (shop.owner_id) and a signed-in customer's under that customer, so the owner-scoped grant showed a cashier or a manager none of them, and the Corner Cup simulation's staff signed in as the owner to do their jobs, which attributes every act to one login. Read only: changes go through app-counter's actions (void, hand over, corrections), which keep an order and its invoice in step and record who did it and why"},
23 {"effect": "allow", "principal": "role:manager", "actions": ["update"], "collection": "disputes", "reason": "a manager settles a claim whoever took the call: role:manager may update (and so resolve) every dispute, not only those it opened, because under an owner-only rule a dispute the cashier opened could only ever be closed by that cashier, who may not pay one out. Update only, no create on another's behalf and no delete. Being able to update every dispute is also what the resolve action asks before it gives anything away, so this is the payout grant; it grants nothing on orders or payments. role:shift_lead is deliberately left out: across the shipped packages money decisions (payment and refund writes, invoice changes, subscription credit) are manager and owner work, and a shift lead, who may approve a counter correction, holds no payment, refund or invoice write of their own. Status moves over the record API stay with the dispute's owner (the schema's transition guards); a manager closes another's dispute through action_resolve_dispute. Cashiers keep update on the disputes they opened only (the registered rule above)"},
24 {"effect": "allow", "principal": "role:owner", "actions": ["update"], "collection": "disputes", "reason": "a manager settles a claim whoever took the call: role:owner may update (and so resolve) every dispute, not only those it opened, because under an owner-only rule a dispute the cashier opened could only ever be closed by that cashier, who may not pay one out. Update only, no create on another's behalf and no delete. Being able to update every dispute is also what the resolve action asks before it gives anything away, so this is the payout grant; it grants nothing on orders or payments. role:shift_lead is deliberately left out: across the shipped packages money decisions (payment and refund writes, invoice changes, subscription credit) are manager and owner work, and a shift lead, who may approve a counter correction, holds no payment, refund or invoice write of their own. Status moves over the record API stay with the dispute's owner (the schema's transition guards); a manager closes another's dispute through action_resolve_dispute. Cashiers keep update on the disputes they opened only (the registered rule above)"},
25 {"effect": "allow", "principal": "role:cashier", "actions": ["execute"], "object_id": "action_open_dispute", "reason": "opening a dispute is counter work: the person taking the call records the claim about the shop's sale. Over the record API a dispute may point only at an order its writer may update, which no staff role holds on shop orders (and should not: that would let them reprice and void bills), so staff open one through this action instead. The action checks the role itself (object_corrections.staff_refusal), reads the order and payment as the caller (staff read every sale), takes a shipment only as that order's own, refuses a payment that is not on the order's bill, and writes an open dispute owned by the caller; it writes nothing on the order, payment or shipment"},
26 {"effect": "allow", "principal": "role:shift_lead", "actions": ["execute"], "object_id": "action_open_dispute", "reason": "opening a dispute is counter work: the person taking the call records the claim about the shop's sale. Over the record API a dispute may point only at an order its writer may update, which no staff role holds on shop orders (and should not: that would let them reprice and void bills), so staff open one through this action instead. The action checks the role itself (object_corrections.staff_refusal), reads the order and payment as the caller (staff read every sale), takes a shipment only as that order's own, refuses a payment that is not on the order's bill, and writes an open dispute owned by the caller; it writes nothing on the order, payment or shipment"},
27 {"effect": "allow", "principal": "role:manager", "actions": ["execute"], "object_id": "action_open_dispute", "reason": "opening a dispute is counter work: the person taking the call records the claim about the shop's sale. Over the record API a dispute may point only at an order its writer may update, which no staff role holds on shop orders (and should not: that would let them reprice and void bills), so staff open one through this action instead. The action checks the role itself (object_corrections.staff_refusal), reads the order and payment as the caller (staff read every sale), takes a shipment only as that order's own, refuses a payment that is not on the order's bill, and writes an open dispute owned by the caller; it writes nothing on the order, payment or shipment"},
28 {"effect": "allow", "principal": "role:owner", "actions": ["execute"], "object_id": "action_open_dispute", "reason": "opening a dispute is counter work: the person taking the call records the claim about the shop's sale. Over the record API a dispute may point only at an order its writer may update, which no staff role holds on shop orders (and should not: that would let them reprice and void bills), so staff open one through this action instead. The action checks the role itself (object_corrections.staff_refusal), reads the order and payment as the caller (staff read every sale), takes a shipment only as that order's own, refuses a payment that is not on the order's bill, and writes an open dispute owned by the caller; it writes nothing on the order, payment or shipment"}
29 ]
30}