[pve-devel] [PATCH manager 6/7] ui: qemu/HardwareView: check EFI Disk button permissions

Aaron Lauterer a.lauterer at proxmox.com
Mon Feb 1 15:21:30 CET 2021


Make sure that the `Add EFI Disk` button is disabled if the user does
not have the needed permissions.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index 80d6eec1..252a8e72 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -561,6 +561,7 @@ Ext.define('PVE.qemu.HardwareView', {
 	    const noSysConsolePerm = !caps.nodes['Sys.Console'];
 	    const noVMConfigHWTypePerm = !caps.vms['VM.Config.HWType'];
 	    const noVMConfigNetPerm = !caps.vms['VM.Config.Network'];
+	    const noVMConfigDiskPerm = !caps.vms['VM.Config.Disk'];
 
 
 	    me.down('#addusb').setDisabled(noSysConsolePerm || isAtLimit('usb'));
@@ -569,7 +570,7 @@ Ext.define('PVE.qemu.HardwareView', {
 	    me.down('#addserial').setDisabled(noVMConfigHWTypePerm || isAtLimit('serial'));
 	    me.down('#addnet').setDisabled(noVMConfigNetPerm || isAtLimit('net'));
 	    me.down('#addrng').setDisabled(noSysConsolePerm || isAtLimit('rng'));
-	    efidisk_menuitem.setDisabled(isAtLimit('efidisk'));
+	    efidisk_menuitem.setDisabled(noVMConfigDiskPerm || isAtLimit('efidisk'));
 	    me.down('#addci').setDisabled(noSysConsolePerm || hasCloudInit);
 
 	    if (!rec) {
-- 
2.20.1






More information about the pve-devel mailing list