+ my ($volid, $storeid) = &$real_volume_id($param->{storage}, $param->{volume});
+
+ my ($path, $ownervm, $vtype) = PVE::Storage::path($cfg, $volid);
+ if ($vtype eq 'backup' && $ownervm) {
+ $rpcenv->check($authuser, "/storage/$storeid", ['Datastore.AllocateSpace']);
+ $rpcenv->check($authuser, "/vms/$ownervm", ['VM.Backup']);
+ } else {
+ $rpcenv->check($authuser, "/storage/$storeid", ['Datastore.Allocate']);
+ }
+