]> git.proxmox.com Git - qemu-server.git/commitdiff
create template: fix permission check
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 3 May 2013 07:10:39 +0000 (09:10 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 3 May 2013 07:14:25 +0000 (09:14 +0200)
This function only works if the VM already exists. But pool permissions
are automatically inherited on existing VMs, so there is no need
to explicitly check pool permissions.

PVE/API2/Qemu.pm

index 1e475aacde03459f44e81083acd56188d4d258cb..218ee7cb19104d5068ad3548d3826d1cb42432af 100644 (file)
@@ -2702,11 +2702,8 @@ __PACKAGE__->register_method({
     proxyto => 'node',
     description => "Create a Template.",
     permissions => {
-       description => "You need 'VM.Allocate' permissions on /vms/{vmid} or on the VM pool /pool/{pool}.",
-       check => [ 'or',
-                  [ 'perm', '/vms/{vmid}', ['VM.Allocate']],
-                  [ 'perm', '/pool/{pool}', ['VM.Allocate'], require_param => 'pool'],
-           ],
+       description => "You need 'VM.Allocate' permissions on /vms/{vmid}",
+       check => [ 'perm', '/vms/{vmid}', ['VM.Allocate']],
     },
     parameters => {
        additionalProperties => 0,
@@ -2765,6 +2762,4 @@ __PACKAGE__->register_method({
        return undef;
     }});
 
-
-
 1;