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 <f.ebner@proxmox.com>
This commit is contained in:
committed by
Fabian Grünbichler
parent
3e1a618e34
commit
42352a4988
@ -488,6 +488,9 @@ sub check_volume_access {
|
|||||||
} elsif ($vtype eq 'backup' && $ownervm) {
|
} elsif ($vtype eq 'backup' && $ownervm) {
|
||||||
$rpcenv->check($user, "/storage/$sid", ['Datastore.AllocateSpace']);
|
$rpcenv->check($user, "/storage/$sid", ['Datastore.AllocateSpace']);
|
||||||
$rpcenv->check($user, "/vms/$ownervm", ['VM.Backup']);
|
$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 {
|
} else {
|
||||||
die "missing privileges to access $volid\n";
|
die "missing privileges to access $volid\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user