From 044b08f2552cdbbffdd20cd9e63c79b9e5eb3e48 Mon Sep 17 00:00:00 2001 From: Mira Limbeck Date: Thu, 25 Jun 2020 16:48:48 +0200 Subject: [PATCH] change permissions for non-network cloudinit settings With the introduction of VM.Config.Cloudinit we can set the user, password and an SSH key without VM.Config.Network permission. Keep the fallback for VM.Config.Network so custom roles don't break. Signed-off-by: Mira Limbeck --- www/manager6/qemu/CloudInit.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js index c6ff4626..1f7631f7 100644 --- a/www/manager6/qemu/CloudInit.js +++ b/www/manager6/qemu/CloudInit.js @@ -192,6 +192,8 @@ Ext.define('PVE.qemu.CloudInit', { me.editorConfig.url = me.baseurl + '/config'; me.editorConfig.pveSelNode = me.pveSelNode; + let caps_ci = caps.vms['VM.Config.Cloudinit']; + || caps.vms['VM.Config.Network']; /* editor is string and object */ me.rows = { ciuser: { @@ -199,7 +201,7 @@ Ext.define('PVE.qemu.CloudInit', { iconCls: 'fa fa-user', never_delete: true, defaultValue: '', - editor: caps.vms['VM.Config.Options'] ? { + editor: caps_ci ? { xtype: 'proxmoxWindowEdit', subject: gettext('User'), items: [ @@ -220,7 +222,7 @@ Ext.define('PVE.qemu.CloudInit', { header: gettext('Password'), iconCls: 'fa fa-unlock', defaultValue: '', - editor: caps.vms['VM.Config.Options'] ? { + editor: caps_ci ? { xtype: 'proxmoxWindowEdit', subject: gettext('Password'), items: [ @@ -255,7 +257,7 @@ Ext.define('PVE.qemu.CloudInit', { sshkeys: { header: gettext('SSH public key'), iconCls: 'fa fa-key', - editor: caps.vms['VM.Config.Network'] ? 'PVE.qemu.SSHKeyEdit' : undefined, + editor: caps_ci ? 'PVE.qemu.SSHKeyEdit' : undefined, never_delete: true, renderer: function(value) { value = decodeURIComponent(value);