From 7af0a6c88d37a1e1cd6bd26a57fb16fdd784d448 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 3 May 2013 09:10:39 +0200 Subject: [PATCH] create template: fix permission check 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 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 1e475aac..218ee7cb 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -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; -- 2.39.5