[pve-devel] [PATCH manager] ui: qemu: hardware: fix permission check for adding tpmstate volume

Friedrich Weber f.weber at proxmox.com
Mon Aug 5 15:33:37 CEST 2024


Previously, the "Add -> TPM State" menu item in the GUI was disabled
if the user did not have Sys.Console privileges. This deviated from
the permission check in the backend, which does not require
Sys.Console but (among others) VM.Config.Disk.

Fix this inconsistency by checking for VM.Config.Disk in the frontend
instead of Sys.Console.

Reported in enterprise support.

Signed-off-by: Friedrich Weber <f.weber at proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index e1902695..86d5f4cf 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -593,7 +593,7 @@ Ext.define('PVE.qemu.HardwareView', {
 	    me.down('#addNet').setDisabled(noVMConfigNetPerm || isAtLimit('net'));
 	    me.down('#addRng').setDisabled(noSysConsolePerm || isAtLimit('rng'));
 	    efidisk_menuitem.setDisabled(noVMConfigDiskPerm || isAtLimit('efidisk'));
-	    me.down('#addTpmState').setDisabled(noSysConsolePerm || isAtLimit('tpmstate'));
+	    me.down('#addTpmState').setDisabled(noVMConfigDiskPerm || isAtLimit('tpmstate'));
 	    me.down('#addCloudinitDrive').setDisabled(noVMConfigCDROMPerm || noVMConfigCloudinitPerm || hasCloudInit);
 
 	    if (!rec) {
-- 
2.39.2





More information about the pve-devel mailing list