From: Dietmar Maurer Date: Mon, 6 Feb 2012 10:41:48 +0000 (+0100) Subject: check storage permissions on vzdump API X-Git-Url: https://git.proxmox.com/?p=pve-manager.git;a=commitdiff_plain;h=4412265f0280391296f09e3d53c32bb782b91f4e check storage permissions on vzdump API --- diff --git a/PVE/API2/VZDump.pm b/PVE/API2/VZDump.pm index 1c074332..935e2e97 100644 --- a/PVE/API2/VZDump.pm +++ b/PVE/API2/VZDump.pm @@ -23,7 +23,7 @@ __PACKAGE__->register_method ({ method => 'POST', description => "Create backup.", permissions => { - description => "The user needs VM.Backup permissions on any VM.", + description => "The user needs 'VM.Backup' permissions on any VM, and 'Datastore.AllocateSpace' on the backup storage.", user => 'all', }, protected => 1, @@ -108,6 +108,9 @@ __PACKAGE__->register_method ({ if defined($param->{$key}) && ($user ne 'root@pam'); } + $rpcenv->check($user, "/storage/$param->{storage}", [ 'Datastore.AllocateSpace' ]) + if $param->{storage}; + my $vzdump = PVE::VZDump->new($cmdline, $param, $skiplist); my $worker = sub {