fix: Event-bus workflow trigger, RBAC on all routes, search provider, events, cron jobs

Critical fixes:
- Event Bus → Workflow auto-trigger: wildcard subscription starts workflows on matching events
- Kommunikation routes: require_permission on all 30+ endpoints (comm:read/write/delete/manage)
- Permissions routes: require_permission('permissions:admin') on all management endpoints
- CompanySearchProvider registered in auto_register_providers()

Medium fixes:
- system_notif events: 10 event_bus.publish() calls added (lead.created, contact.created/updated,
  task.created/overdue, mail.received, user.created, workflow.completed, notification.created, backup.*)
- Cron jobs: backup_check (daily), search_index_check (daily), workflow_timeout (5min) registered
- AI tool permission: call_crm_api now requires 'ai:write' permission
- New file: automation/jobs.py with backup_check and search_index_check functions
This commit is contained in:
Agent Zero
2026-07-25 03:22:55 +02:00
parent b01c798739
commit 6e7e39d101
14 changed files with 266 additions and 22 deletions
+11
View File
@@ -92,6 +92,17 @@ async def create_user(
f"Your account has been created by {current_user['name']}.",
)
# Publish user.created event
from app.core.event_bus import get_event_bus
event_bus = get_event_bus()
await event_bus.publish('user.created', {
'user_id': str(user.id),
'tenant_id': str(tenant_id),
'email': body.email,
'name': body.name,
'role': body.role,
})
return {
"id": str(user.id),
"email": user.email,