Fix 11 failing API tests across 4 files

This commit is contained in:
copilot-swe-agent[bot]
2026-07-07 00:31:43 +00:00
committed by GitHub
parent d9fbba3130
commit 57bcbaf72a
4 changed files with 34 additions and 20 deletions
@@ -29,6 +29,21 @@ class limited_backoffice_service
self::PERMISSION_PUBLIC_EMPLOYEE_DATA,
];
/**
* Permissions that are always granted to managed employees when present in a role preset,
* regardless of whether the creating manager holds those permissions themselves.
*
* @var array<int, string>
*/
private const ROLE_UNCONDITIONAL_PERMISSIONS = [
'list_departments',
'list_department_daily_reports',
'list_notifications',
'list_own_notifications',
'statistics_orders_new',
'statistics_bookings_new',
];
/**
* @var array<string, array{label:string,description:string,permissions:array<int,string>}>
*/
@@ -1638,6 +1653,11 @@ class limited_backoffice_service
continue;
}
if (in_array($permission, self::ROLE_UNCONDITIONAL_PERMISSIONS, true)) {
$permissions[] = $permission;
continue;
}
if ($manager->hasPermission($permission)) {
$permissions[] = $permission;
}