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] 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
|
- [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 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
|
### Packages to release
|
||||||
|
|
||||||
|
@ -629,7 +629,8 @@ const getLinkedObjectsByTaskRefOrId = create(
|
|||||||
export const getResolvedPendingTasks = create(
|
export const getResolvedPendingTasks = create(
|
||||||
createGetObjectsOfType('task').filter([task => task.status === 'pending']),
|
createGetObjectsOfType('task').filter([task => task.status === 'pending']),
|
||||||
getLinkedObjectsByTaskRefOrId,
|
getLinkedObjectsByTaskRefOrId,
|
||||||
(tasks, linkedObjectsByTaskRefOrId) => {
|
getCheckPermissions,
|
||||||
|
(tasks, linkedObjectsByTaskRefOrId, check) => {
|
||||||
const resolvedTasks = []
|
const resolvedTasks = []
|
||||||
forEach(tasks, task => {
|
forEach(tasks, task => {
|
||||||
const objects = [
|
const objects = [
|
||||||
@ -638,10 +639,13 @@ export const getResolvedPendingTasks = create(
|
|||||||
// { taskId → operation } map instead of { taskRef → operation } map
|
// { taskId → operation } map instead of { taskRef → operation } map
|
||||||
...defined(linkedObjectsByTaskRefOrId[task.id], []),
|
...defined(linkedObjectsByTaskRefOrId[task.id], []),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (objects.length > 0 || check(task.$host, 'view')) {
|
||||||
resolvedTasks.push({
|
resolvedTasks.push({
|
||||||
...task,
|
...task,
|
||||||
objects,
|
objects,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return resolvedTasks
|
return resolvedTasks
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user