feat(acl): add bot security policy presets

Initialize new bots with preset ACL templates and an allow-by-default fallback so common access setups can be selected during bot creation instead of being configured manually afterward.
This commit is contained in:
BBQ
2026-04-14 04:38:53 +08:00
committed by 晨苒
parent 0e6c8ca451
commit 60517bc2a6
24 changed files with 1033 additions and 93 deletions
@@ -0,0 +1,14 @@
-- 0066_acl_default_allow
-- Restore the bot ACL default effect to deny for newly created bots.
DO $$
BEGIN
IF EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_name = 'bots' AND column_name = 'acl_default_effect'
) THEN
ALTER TABLE bots
ALTER COLUMN acl_default_effect SET DEFAULT 'deny';
END IF;
END $$;
@@ -0,0 +1,14 @@
-- 0066_acl_default_allow
-- Change the bot ACL default effect to allow for newly created bots.
DO $$
BEGIN
IF EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_name = 'bots' AND column_name = 'acl_default_effect'
) THEN
ALTER TABLE bots
ALTER COLUMN acl_default_effect SET DEFAULT 'allow';
END IF;
END $$;