mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-28 11:01:13 +00:00
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:
parent
d703d4c010
commit
7af0a6c88d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user