From 42352a4988ce9c743543102ef1a04627537ea81c Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Wed, 30 Mar 2022 12:24:30 +0200 Subject: [PATCH] check volume access: allow for images/rootdir if user has VM.Config.Disk Listing guest images should not require Datastore.Allocate in this case. In preparation for adding disk import to the GUI. Signed-off-by: Fabian Ebner --- PVE/Storage.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 0349564..a864c33 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -488,6 +488,9 @@ sub check_volume_access { } elsif ($vtype eq 'backup' && $ownervm) { $rpcenv->check($user, "/storage/$sid", ['Datastore.AllocateSpace']); $rpcenv->check($user, "/vms/$ownervm", ['VM.Backup']); + } elsif (($vtype eq 'images' || $vtype eq 'rootdir') && $ownervm) { + $rpcenv->check($user, "/storage/$sid", ['Datastore.Audit']); + $rpcenv->check($user, "/vms/$ownervm", ['VM.Config.Disk']); } else { die "missing privileges to access $volid\n"; }