rework issue system

This commit is contained in:
Matthias Hochmeister
2026-03-24 15:30:24 +01:00
parent 65994286b2
commit d8d2730547
9 changed files with 316 additions and 186 deletions

View File

@@ -0,0 +1,20 @@
-- Migration 055: Ensure wissen:view and bestellungen:view are seeded for all dashboard groups
-- Re-seeds permissions that may be missing due to migration ordering or cascade deletes.
-- Uses ON CONFLICT DO NOTHING — safe to run multiple times.
DO $$
DECLARE
grp TEXT;
BEGIN
FOR grp IN
SELECT DISTINCT authentik_group FROM group_permissions WHERE authentik_group LIKE 'dashboard_%'
LOOP
INSERT INTO group_permissions (authentik_group, permission_id)
VALUES (grp, 'wissen:view'), (grp, 'wissen:widget_recent'), (grp, 'wissen:widget_search')
ON CONFLICT DO NOTHING;
INSERT INTO group_permissions (authentik_group, permission_id)
VALUES (grp, 'bestellungen:view')
ON CONFLICT DO NOTHING;
END LOOP;
END $$;