forked from fa/breadcrumb-the-shire
- add helpdesk module pages, services, settings and tests - standardize debtor list on drawer/grid contracts and robust filter drawer behavior - add helpdesk aside panel navigation and settings visibility provider - switch primary list slug to helpdesk/debitor and remove helpdesk/search compatibility - include required core contract updates for list contracts and detail/drawer integration
21 lines
808 B
SQL
21 lines
808 B
SQL
-- Helpdesk module: assign permissions to Admin and Support roles.
|
|
-- Admin gets full access (helpdesk.access + helpdesk.settings.manage).
|
|
-- Support gets helpdesk.access only.
|
|
-- Idempotent: safe to run multiple times.
|
|
|
|
-- Admin: full helpdesk access
|
|
INSERT INTO `role_permissions` (`role_id`, `permission_id`, `created`)
|
|
SELECT r.id, p.id, NOW()
|
|
FROM roles r
|
|
JOIN permissions p ON p.`key` IN ('helpdesk.access', 'helpdesk.settings.manage')
|
|
WHERE r.description IN ('Admin', 'Administrator') OR r.id = 1
|
|
ON DUPLICATE KEY UPDATE role_id = role_id;
|
|
|
|
-- Support: helpdesk read access
|
|
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.access'
|
|
WHERE r.code = 'SUPPORT'
|
|
ON DUPLICATE KEY UPDATE role_id = role_id;
|