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:
@@ -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;
|
||||
Reference in New Issue
Block a user