1
0
Files
breadcrumb-the-shire/db/updates/2026-04-14-helpdesk-software-products-permission.sql
fs 2424f24d27 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>
2026-04-14 22:18:13 +02:00

10 lines
397 B
SQL

-- 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;