fix(config): agrega roles Taller y Mecanico en creacion de empleados
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled

- Agrega opciones workshop y mechanic al select de rol en config.html
- Actualiza ROLE_LABELS y ROLE_BADGE en config.js
- Valida roles mechanic y workshop en config_bp.py con permisos por defecto
- Añade clases CSS badge--orange y badge--teal

Tests: 35 passed
This commit is contained in:
2026-06-30 16:31:45 +00:00
parent c1e481fb79
commit c58f622486
4 changed files with 13 additions and 3 deletions

View File

@@ -200,7 +200,7 @@ def create_employee():
nxt_name = PLANS[nxt]['name'] if nxt else 'Enterprise'
return jsonify({'error': f'Plan limit reached ({limit} employees). Upgrade to {nxt_name}.'}), 403
valid_roles = ['admin', 'cashier', 'warehouse', 'accountant', 'workshop']
valid_roles = ['admin', 'cashier', 'warehouse', 'accountant', 'workshop', 'mechanic']
if data['role'] not in valid_roles:
return jsonify({'error': f'role must be one of: {", ".join(valid_roles)}'}), 400
@@ -239,6 +239,8 @@ def create_employee():
'fleet.view'],
'workshop': ['workshop.view', 'workshop.edit', 'workshop.add_items', 'customers.view',
'fleet.view'],
'mechanic': ['workshop.view', 'workshop.edit', 'workshop.add_items', 'customers.view',
'fleet.view'],
}
for perm in role_permissions.get(data['role'], []):