fix
This commit is contained in:
@@ -186,7 +186,7 @@ def cmd():
|
|||||||
return err("Broker MQTT non raggiungibile - comando non inviato", 503)
|
return err("Broker MQTT non raggiungibile - comando non inviato", 503)
|
||||||
|
|
||||||
audit(auth['username'], cid, cmd_type)
|
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})
|
return jsonify({"success": True})
|
||||||
|
|
||||||
@api_bp.route('/api/global_command', methods=['POST'])
|
@api_bp.route('/api/global_command', methods=['POST'])
|
||||||
@@ -227,7 +227,7 @@ def service_control():
|
|||||||
d = json_body()
|
d = json_body()
|
||||||
cid = str(d.get('clientId', '')).strip().lower()
|
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)
|
return err("Permesso negato per questo nodo", 403)
|
||||||
action = str(d.get('action', '')).strip().lower()
|
action = str(d.get('action', '')).strip().lower()
|
||||||
service = str(d.get('service', '')).strip()
|
service = str(d.get('service', '')).strip()
|
||||||
@@ -326,7 +326,7 @@ def get_config_file(cid, service):
|
|||||||
if not auth or auth['role'] != 'admin':
|
if not auth or auth['role'] != 'admin':
|
||||||
return err("Non autorizzato", 403)
|
return err("Non autorizzato", 403)
|
||||||
cid = cid.lower()
|
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)
|
return err("Permesso negato per questo nodo", 403)
|
||||||
service = service.lower()
|
service = service.lower()
|
||||||
if not CID_RE.match(cid) or not SERVICE_RE.match(service):
|
if not CID_RE.match(cid) or not SERVICE_RE.match(service):
|
||||||
@@ -345,7 +345,7 @@ def save_config_file():
|
|||||||
d = json_body()
|
d = json_body()
|
||||||
cid = str(d.get('clientId', '')).strip().lower()
|
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)
|
return err("Permesso negato per questo nodo", 403)
|
||||||
service = str(d.get('service', '')).strip().lower()
|
service = str(d.get('service', '')).strip().lower()
|
||||||
new_config = d.get('config_data')
|
new_config = d.get('config_data')
|
||||||
|
|||||||
Reference in New Issue
Block a user