From c7c95d877c9b2e7393e7920412335ca39a0e8cb5 Mon Sep 17 00:00:00 2001 From: Roby Date: Sat, 7 Nov 2026 10:46:39 +0100 Subject: [PATCH] fix --- routes/api_routes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routes/api_routes.py b/routes/api_routes.py index 2f55cb6..b92b77a 100644 --- a/routes/api_routes.py +++ b/routes/api_routes.py @@ -186,7 +186,7 @@ def cmd(): return err("Broker MQTT non raggiungibile - comando non inviato", 503) audit(auth['username'], cid, cmd_type) - state.client_telemetry[cid] = {"ts1": "売 Inviato...", "ts2": "売 Inviato...", "alt": ""} + state.client_telemetry[cid] = {"ts1": "[>] Inviato...", "ts2": "[>] Inviato...", "alt": ""} return jsonify({"success": True}) @api_bp.route('/api/global_command', methods=['POST']) @@ -227,7 +227,7 @@ def service_control(): d = json_body() cid = str(d.get('clientId', '')).strip().lower() - if not check_node_allowed(auth['allowed_nodes'], cid): + if not node_allowed(auth['role'], auth['allowed_nodes'], cid): return err("Permesso negato per questo nodo", 403) action = str(d.get('action', '')).strip().lower() service = str(d.get('service', '')).strip() @@ -326,7 +326,7 @@ def get_config_file(cid, service): if not auth or auth['role'] != 'admin': return err("Non autorizzato", 403) cid = cid.lower() - if not check_node_allowed(auth['allowed_nodes'], cid): + if not node_allowed(auth['role'], auth['allowed_nodes'], cid): return err("Permesso negato per questo nodo", 403) service = service.lower() if not CID_RE.match(cid) or not SERVICE_RE.match(service): @@ -345,7 +345,7 @@ def save_config_file(): d = json_body() cid = str(d.get('clientId', '')).strip().lower() - if not check_node_allowed(auth['allowed_nodes'], cid): + if not node_allowed(auth['role'], auth['allowed_nodes'], cid): return err("Permesso negato per questo nodo", 403) service = str(d.get('service', '')).strip().lower() new_config = d.get('config_data')