Signed-off-by: Stefan Priebe <[email protected]>
---
 PVE/API2/Qemu.pm |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index b835575..b245257 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2632,6 +2632,13 @@ __PACKAGE__->register_method({
     protected => 1,
     proxyto => 'node',
     description => "Create a Template.",
+    permissions => {
+       description => "You need 'VM.Allocate' permissions on /vms/{vmid} or on 
the VM pool /pool/{pool}. If you create disks you need 
'Datastore.AllocateSpace' on any used storage.",
+       check => [ 'or', 
+                  [ 'perm', '/vms/{vmid}', ['VM.Allocate']],
+                  [ 'perm', '/pool/{pool}', ['VM.Allocate'], require_param => 
'pool'],
+           ],
+    },
     parameters => {
        additionalProperties => 0,
        properties => {
-- 
1.7.10.4

_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to