[pve-devel] [RFC manager 2/3] fix #6094: api: node HW: allow to get usb info with Sys.Audit on /

Daniel Kral d.kral at proxmox.com
Mon Feb 17 13:19:17 CET 2025


Relax the required permissions to query the current list of locally
available USB devices. The API endpoint does only read the USB topology
from the sysfs but does not modify any system state.

Keep Sys.Modify for backwards compatibility.

Signed-off-by: Daniel Kral <d.kral at proxmox.com>
---
 PVE/API2/Hardware/USB.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Hardware/USB.pm b/PVE/API2/Hardware/USB.pm
index d7cb6607..049d1170 100644
--- a/PVE/API2/Hardware/USB.pm
+++ b/PVE/API2/Hardware/USB.pm
@@ -17,7 +17,7 @@ __PACKAGE__->register_method({
     protected => 1,
     proxyto => "node",
     permissions => {
-	check => ['perm', '/', ['Sys.Modify']],
+	check => ['perm', '/', [ 'Sys.Audit', 'Sys.Modify' ], any => 1],
     },
     parameters => {
 	additionalProperties => 0,
-- 
2.39.5





More information about the pve-devel mailing list