feat: a user may have more than one profile, and may do what any of them may (Marcus, 2026-11-26)
All checks were successful
Build and deploy / Validate source (push) Successful in 8s
Build and deploy / Integration suite on a real stack (push) Successful in 8m1s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m32s

operators.roles holds every profile, the main one first; permissions, moves,
the column order and the machine question are the sum. The operator's machine
rules apply only to the moves Operador alone allows, so an Operador who is also
Revisor releases any sheet (D-29 does not block, Marcus). Usuários gets
"Outros perfis" chips next to the main profile.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-26 10:57:20 -03:00
parent a88e7a3288
commit 4c6e2aac4a
16 changed files with 234 additions and 62 deletions

View File

@@ -26,7 +26,9 @@ const montarSelected=()=>MONTAR.sizes.find(size=>size.letter===$('montar-size').
// Interno orders, the Vendedor only Venda, and Gestão and the administrators
// both. An Interno order uses the fixed internal customer; a Venda one is
// picked from Tiny.
const montarKindNames=()=>ME?.role==='expedicao'?['interno']:ME?.role==='vendedor'?['venda']:['interno','venda'];
// The kinds of each profile, summed (app/api/stamps.py MONTADOR_KINDS).
const montarKindNames=()=>['interno','venda'].filter(kind=>myRoles().some(r=>
r==='expedicao'?kind==='interno':r==='vendedor'?kind==='venda':['superadmin','admin','gestao'].includes(r)));
const montarInternalField=key=>String(MONTAR.internal?.[key]||'');
const montarInternalReady=()=>!!MONTAR.internal&&['name','cnpj','zap','mail'].every(key=>montarInternalField(key).trim());
function montarPaintKind(){