fix(helpdesk): add software-products.manage permission to admin role seed

The new permission was missing from the admin role seed in init.sql and
needed an idempotent update script for existing installations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-14 22:18:13 +02:00
parent ef4473de64
commit 2424f24d27
2 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
-- Helpdesk module: assign software products permission to Admin role.
-- Idempotent: safe to run multiple times.
INSERT INTO `role_permissions` (`role_id`, `permission_id`, `created`)
SELECT r.id, p.id, NOW()
FROM roles r
JOIN permissions p ON p.`key` = 'helpdesk.software-products.manage'
WHERE r.description IN ('Admin', 'Administrator') OR r.id = 1
ON DUPLICATE KEY UPDATE role_id = role_id;