all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-manager] ui: qemu|lxc : fix firewall menu caps
@ 2023-03-21 16:22 Alexandre Derumier
  0 siblings, 0 replies; only message in thread
From: Alexandre Derumier @ 2023-03-21 16:22 UTC (permalink / raw)
  To: pve-devel

The current Vm.Console caps is wrong.

Only log api need Vm.Console

other api call need Vm.Audit or VM.Config.Network

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 www/manager6/lxc/Config.js  | 7 ++++++-
 www/manager6/qemu/Config.js | 9 +++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index 23c17d2e..4f96c801 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -304,7 +304,7 @@ Ext.define('PVE.lxc.Config', {
 	    });
 	}
 
-	if (caps.vms['VM.Console']) {
+	if (caps.vms['VM.Audit'] || caps.vms['VM.Config.Network']) {
 	    me.items.push(
 		{
 		    xtype: 'pveFirewallRules',
@@ -342,6 +342,11 @@ Ext.define('PVE.lxc.Config', {
 		    list_refs_url: base_url + '/firewall/refs',
 		    itemId: 'firewall-ipset',
 		},
+	    );
+	}
+
+	if (caps.vms['VM.Console']) {
+	    me.items.push(
 		{
 		    title: gettext('Log'),
 		    groups: ['firewall'],
diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index 94c540c5..d1d01cc9 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -339,7 +339,7 @@ Ext.define('PVE.qemu.Config', {
 	    });
 	}
 
-	if (caps.vms['VM.Console']) {
+	if (caps.vms['VM.Audit'] || caps.vms['VM.Config.Network']) {
 	    me.items.push(
 		{
 		    xtype: 'pveFirewallRules',
@@ -377,7 +377,12 @@ Ext.define('PVE.qemu.Config', {
 		    list_refs_url: base_url + '/firewall/refs',
 		    itemId: 'firewall-ipset',
 		},
-		{
+	    );
+	}
+
+	if (caps.vms['VM.Console']) {
+            me.items.push(
+                {
 		    title: gettext('Log'),
 		    groups: ['firewall'],
 		    iconCls: 'fa fa-list',
-- 
2.30.2




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-21 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 16:22 [pve-devel] [PATCH pve-manager] ui: qemu|lxc : fix firewall menu caps Alexandre Derumier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal