mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
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:
@@ -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 $$;
|
||||
Reference in New Issue
Block a user