dodil/erp-brick-pos

DODIL ERP brick: point of sale

src/brick_pos/roles.yaml

# The default roles this brick recommends: module.yaml's actors, permission for permission. A starting point, not a rule.
# The brick checks PERMISSIONS only, never a role's name; a composition maps its own pool roles to these permissions.
#
# pos:shop:read_all is an addition to the spec's catalog (reported in AGENTS.md): it is the permission that lets retail
# operations, accountants and the owner see every shop, where a cashier and a shift lead see only the shops they are
# assigned to (POST /shops/{shop_id}/staff) - the spec's row_visibility rule, as a permission rather than a role's name.
# pos:settings:controls (the difference threshold, blind close, the paid-out limit, the time zone) is held by the owner
# ONLY, never by the people it binds.
roles:
  cashier:
  - pos:session:open
  - pos:session:count
  - pos:receipt:sell
  - pos:receipt:refund
  - pos:discount:apply
  - pos:cash:move
  - pos:voucher:sell
  - pos:shop:read
  shift_lead:
  - pos:shop:read
  - pos:session:open
  - pos:session:count
  - pos:receipt:sell
  - pos:receipt:refund
  - pos:discount:apply
  - pos:cash:move
  - pos:voucher:sell
  - pos:session:approve_difference
  - pos:override:approve
  - pos:session:force_close
  - pos:deposit:prepare
  - pos:report:read
  retail_ops:
  - pos:shop:read
  - pos:shop:read_all
  - pos:shop:write
  - pos:register:write
  - pos:layout:write
  - pos:recipe:write
  - pos:report:read
  - pos:settings:write
  accountant:
  - pos:shop:read
  - pos:shop:read_all
  - pos:report:read
  - pos:day:review
  - pos:day:post
  - pos:migration:read
  owner:
  - pos:shop:read
  - pos:shop:read_all
  - pos:report:read
  - pos:settings:controls
  - pos:migration:read
  - pos:migration:sign
  system:
  - pos:receipt:ingest
  - pos:fiscal:sign
  - pos:outbox:dispatch
  - pos:day:derive
  - pos:number_series:claim
  - pos:migration:load
  - pos:migration:reconcile
service_clients: [system]
# pos:receipt:ingest, pos:fiscal:sign, pos:outbox:dispatch, pos:day:derive, pos:number_series:claim, pos:migration:load and
# pos:migration:reconcile are machine permissions: grant them only to the system's service client, one per job.