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.
This commit is contained in:
Dietmar Maurer 2013-05-03 09:10:39 +02:00
parent d703d4c010
commit 7af0a6c88d

View 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;