generalbots/botserver/migrations/6.3.2-01-add-bots-public/up.sql
Rodrigo Rodriguez (Pragmatismo) 7d2d8a5674
All checks were successful
Botlib CI / build (push) Successful in 53s
BotServer CI / build (push) Successful in 19m23s
Bottest CI / build (push) Successful in 45s
BotUI CI / build (push) Successful in 58s
feat: Add bot access control with org membership check (#499)
- Add is_public column to bots table (migration 6.3.2-01)
- Add user_organizations to Diesel schema for org membership lookup
- Implement check_bot_access(): public bots allow all users, private bots
  require user membership in the bot's organization via user_organizations
- Wire access check into websocket_handler before WS upgrade
- Read is_public from bots table instead of bot_configuration
- Add database_name field to Bot model
2026-04-26 19:45:30 -03:00

2 lines
134 B
SQL

ALTER TABLE bots ADD COLUMN IF NOT EXISTS is_public BOOLEAN DEFAULT FALSE;
UPDATE bots SET is_public = FALSE WHERE is_public IS NULL;