@pdonias said in Permissions for users to be able to snapshot:
@sborrill Is the user a member of the resource set that you created?
The user was not explicitly a member, but was a member of a group that was. When I added the user to the resource set, I could snapshot, so it appears that the problem is that group inheritance does not work.
When I removed the user from the resource group (to double-check), it removed all the ACLs from the VM so that it was no longer visible to that user (or group). This looks like a bug. I had to use the share option against the resource set on the advanced settings to grant visibility again.
Does the VM belong to that same resource set?
Yes
Could you post the full error log that you get when the Self Service user tries to snapshot the VM?
vm.snapshot
{
"id": "2af0ed72-7602-ad3a-142f-6f73e556d8b9"
}
{
"code": 2,
"data": {
"permission": "operate",
"object": {
"id": "d0e48e5f-7012-d7c9-e300-0bd33f55d4d9"
}
},
"message": "not enough permissions",
"name": "XoError",
"stack": "XoError: not enough permissions
at factory (/opt/xen-orchestra/packages/xo-common/src/api-errors.js:21:32)
at Object.assert (/opt/xen-orchestra/packages/xo-acl-resolver/index.js:132:17)
at default.checkPermissions (file:///opt/xen-orchestra/packages/xo-server/src/xo-mixins/acls.mjs:109:17)
at Object.<anonymous> (file:///opt/xen-orchestra/packages/xo-server/src/api/vm.mjs:818:5)
at Api.callApiMethod (file:///opt/xen-orchestra/packages/xo-server/src/xo-mixins/api.mjs:307:20)"
}
@sborrill said in Permissions for users to be able to snapshot:
(related question, can an existing VM be added to a self-service resource group?)
It appears not. The Web GUI makes it look like you can by allowing you to pick a resource set but you get the following error:
vm.set
{
"resourceSet": "7hFH8vTa74k",
"id": "44ebddd1-2a33-8775-033a-677b993b103e"
}
{
"message": "the vm is not in a resource set",
"name": "Error",
"stack": "Error: the vm is not in a resource set
at _class2.shareVmResourceSet (file:///opt/xen-orchestra/packages/xo-server/src/xo-mixins/resource-sets.mjs:425:13)
at _class2.setVmResourceSet (file:///opt/xen-orchestra/packages/xo-server/src/xo-mixins/resource-sets.mjs:417:18)
at runMicrotasks (<anonymous>)
at runNextTicks (node:internal/process/task_queues:61:5)
at processImmediate (node:internal/timers:437:9)
at process.topLevelDomainCallback (node:domain:152:15)
at process.callbackTrampoline (node:internal/async_hooks:128:24)
at Object.<anonymous> (file:///opt/xen-orchestra/packages/xo-server/src/api/vm.mjs:530:5)
at Api.callApiMethod (file:///opt/xen-orchestra/packages/xo-server/src/xo-mixins/api.mjs:307:20)"
}