]> git.proxmox.com Git - pve-manager.git/commitdiff
check storage permissions on vzdump API
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 6 Feb 2012 10:41:48 +0000 (11:41 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 6 Feb 2012 10:41:48 +0000 (11:41 +0100)
PVE/API2/VZDump.pm

index 1c0743320862e1a88a8707694722bb7ee959e96a..935e2e97ba3e2dec5164aa03dbc9268e7698e028 100644 (file)
@@ -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 {