feat: Kanban profiles, a Usuários page, and machines that route orders
Every operator could do everything, and accounts were made from the console. Each account now has a profile, checked by the server on every action: Administrador (everything, plus users and machines), Gestão (everything but users), Operador (moves cards and handles artwork) and Vendedor (reads orders, quotes and Números, changes nothing). The superadmin is the system's own account, set from the console and kept by the account OPERATOR_EMAIL seeds; administrators cannot change it, and nobody can delete, disable or demote themselves. The Usuários tab creates, edits, disables and deletes users with a first password (there is no e-mail yet), and registers machines with the products each prints. An order goes to the first active machine that prints its product, or to the one chosen in its panel; an operator tied to machines sees and downloads only their orders. Everyone changes their own password in the account menu, which now holds the name and Sair too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ from starlette.middleware.trustedhost import TrustedHostMiddleware
|
||||
from .core import db
|
||||
from .core.auth import audit, client_ip
|
||||
from .runtime import ALLOWED_HOSTS, ALLOWED_ORIGINS, storage
|
||||
from .api import artwork, customer, health, operator, orders, payments, quotes, uploads
|
||||
from .api import artwork, customer, health, operator, orders, payments, quotes, uploads, users
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@@ -45,5 +45,5 @@ async def safe_headers(request, call_next):
|
||||
|
||||
|
||||
# Order is not significant: no two routers declare the same path.
|
||||
for module in (health, uploads, quotes, orders, payments, operator, customer, artwork):
|
||||
for module in (health, uploads, quotes, orders, payments, operator, customer, artwork, users):
|
||||
app.include_router(module.router)
|
||||
|
||||
Reference in New Issue
Block a user