fix(xo-web/tasks): fix tasks being displayed to all users (#6422)
See zammad#9509
Introduced by e246c8ee47
This commit is contained in:
parent
99a1dbeae1
commit
ce78d22bb8
@ -19,6 +19,7 @@
|
||||
- [Backup] Launch Health Check after a full backup (PR [#6401](https://github.com/vatesfr/xen-orchestra/pull/6401))
|
||||
- [Backup] Fix `Lock file is already being held` error when deleting a VM backup while the VM is currently being backed up
|
||||
- [Tasks] Fix the pool filter that did not display tasks even if they existed (PR [#6424](https://github.com/vatesfr/xen-orchestra/pull/6424))
|
||||
- [Tasks] Fix tasks being displayed for all users (PR [#6422](https://github.com/vatesfr/xen-orchestra/pull/6422))
|
||||
|
||||
### Packages to release
|
||||
|
||||
|
@ -629,7 +629,8 @@ const getLinkedObjectsByTaskRefOrId = create(
|
||||
export const getResolvedPendingTasks = create(
|
||||
createGetObjectsOfType('task').filter([task => task.status === 'pending']),
|
||||
getLinkedObjectsByTaskRefOrId,
|
||||
(tasks, linkedObjectsByTaskRefOrId) => {
|
||||
getCheckPermissions,
|
||||
(tasks, linkedObjectsByTaskRefOrId, check) => {
|
||||
const resolvedTasks = []
|
||||
forEach(tasks, task => {
|
||||
const objects = [
|
||||
@ -638,10 +639,13 @@ export const getResolvedPendingTasks = create(
|
||||
// { taskId → operation } map instead of { taskRef → operation } map
|
||||
...defined(linkedObjectsByTaskRefOrId[task.id], []),
|
||||
]
|
||||
resolvedTasks.push({
|
||||
...task,
|
||||
objects,
|
||||
})
|
||||
|
||||
if (objects.length > 0 || check(task.$host, 'view')) {
|
||||
resolvedTasks.push({
|
||||
...task,
|
||||
objects,
|
||||
})
|
||||
}
|
||||
})
|
||||
return resolvedTasks
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user