fix(config): agrega roles Taller y Mecanico en creacion de empleados
- 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:
@@ -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'], []):
|
||||
|
||||
Reference in New Issue
Block a user