forked from fa/breadcrumb-the-shire
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:
@@ -1551,7 +1551,7 @@ JOIN permissions p ON p.`key` IN (
|
||||
'mail_log.view', 'api_audit.view', 'system_audit.view', 'system_audit.purge',
|
||||
'stats.view', 'system_info.view',
|
||||
'roles.assign_all',
|
||||
'helpdesk.access', 'helpdesk.settings.manage', 'helpdesk.team-workload.view', 'helpdesk.risk-radar.view'
|
||||
'helpdesk.access', 'helpdesk.settings.manage', 'helpdesk.team-workload.view', 'helpdesk.risk-radar.view', 'helpdesk.software-products.manage'
|
||||
)
|
||||
WHERE r.description IN ('Admin', 'Administrator') OR r.id = 1
|
||||
ON DUPLICATE KEY UPDATE role_id = role_id;
|
||||
|
||||
@@ -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