Release v4928.1.4.2 stable
This commit is contained in:
23
app/posting_policy.py
Normal file
23
app/posting_policy.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from app.schemas import ActionResult
|
||||
|
||||
|
||||
def can_post_private_note(action_result: ActionResult) -> bool:
|
||||
"""
|
||||
Política de segurança para escrever notas privadas no Chatwoot.
|
||||
|
||||
Só permite publicar notas para ações realmente operacionais.
|
||||
Bloqueia spam, revisão manual e ações sem necessidade operacional.
|
||||
"""
|
||||
if not action_result.safe_to_post:
|
||||
return False
|
||||
|
||||
if not action_result.action_required:
|
||||
return False
|
||||
|
||||
if action_result.route in {"spam", "rever"}:
|
||||
return False
|
||||
|
||||
if not str(action_result.action or "").strip():
|
||||
return False
|
||||
|
||||
return True
|
||||
Reference in New Issue
Block a user