[pve-devel] [PATCH v3 manager 13/17] ui: lxc features: check for SU instead of 'root at pam'

Oguz Bektas o.bektas at proxmox.com
Wed Apr 6 13:57:30 CEST 2022


Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
v2->v3:
* added new, previously the editor was still double-clickable eventhough the 'edit'
button was grayed out
* check for SU instead of root at pam

 www/manager6/lxc/Options.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/www/manager6/lxc/Options.js b/www/manager6/lxc/Options.js
index d0a53fc7..7aa18447 100644
--- a/www/manager6/lxc/Options.js
+++ b/www/manager6/lxc/Options.js
@@ -175,9 +175,13 @@ Ext.define('PVE.lxc.Options', {
 
 	    if (key === 'features') {
 		let unprivileged = me.getStore().getById('unprivileged').data.value;
-		let root = Proxmox.UserName === 'root at pam';
+		let superuser = caps.vms['SuperUser']; // eslint-disable-line
 		let vmalloc = caps.vms['VM.Allocate'];
-		edit_btn.setDisabled(!(root || (vmalloc && unprivileged)));
+		let disabled = !(superuser || (vmalloc && unprivileged));
+		edit_btn.setDisabled(disabled);
+		if (disabled) {
+		    rowdef.editor = undefined;
+		}
 	    } else {
 		edit_btn.setDisabled(!rowdef.editor);
 	    }
-- 
2.30.2






More information about the pve-devel mailing list