fix(xo-server/snapshot): allow self user that is member of a group to snapshot (#7129)
Introduced by a88798cc22
See Zammad#18478
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
- [Usage report] Fix "Converting circular structure to JSON" error (PR [#7096](https://github.com/vatesfr/xen-orchestra/pull/7096))
|
||||
- [Usage report] Fix "Cannot convert undefined or null to object" error (PR [#7092](https://github.com/vatesfr/xen-orchestra/pull/7092))
|
||||
- [Plugin/transport-xmpp] Fix plugin load
|
||||
- [Self Service] Fix Self users not being able to snapshot VMs when they're members of a user group (PR [#7129](https://github.com/vatesfr/xen-orchestra/pull/7129))
|
||||
|
||||
### Packages to release
|
||||
|
||||
|
||||
@@ -973,7 +973,12 @@ export const snapshot = defer(async function (
|
||||
}
|
||||
}
|
||||
|
||||
if (resourceSet === undefined || !resourceSet.subjects.includes(user.id)) {
|
||||
// Workaround: allow Resource Set members to snapshot a VM even though they
|
||||
// don't have operate permissions on the SR(s)
|
||||
if (
|
||||
resourceSet === undefined ||
|
||||
(!resourceSet.subjects.includes(user.id) && !user.groups.some(groupId => resourceSet.subjects.includes(groupId)))
|
||||
) {
|
||||
await checkPermissionOnSrs.call(this, vm)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user