Security fix

This commit is contained in:
2026-11-08 16:20:23 +01:00
parent 93fc177911
commit 311c4053f0
15 changed files with 281 additions and 50 deletions
+10
View File
@@ -0,0 +1,10 @@
"""Controllo permessi sui nodi, condiviso da API, push e WebSocket (nessuna dipendenza interna)."""
def node_allowed(role, allowed_nodes, cid):
if role == 'admin':
return True
allowed = (allowed_nodes or '').strip().lower()
if allowed == 'all':
return True
return cid in [x.strip().lower() for x in allowed.split(',') if x.strip()]