+my sub assert_param_permission_vzdump {
+ my ($rpcenv, $user, $param) = @_;
+ return if $user eq 'root@pam'; # always OK
+
+ PVE::API2::Backup::assert_param_permission_common($rpcenv, $user, $param);
+
+ if (!$param->{dumpdir} && (defined($param->{maxfiles}) || defined($param->{'prune-backups'}))) {
+ my $storeid = $param->{storage} || 'local';
+ $rpcenv->check($user, "/storage/$storeid", [ 'Datastore.Allocate' ]);
+ } # no else branch, because dumpdir is root-only
+}
+