From 846defd88cc2ea22d8e25e38135f653c4c98beb4 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 19 Feb 2024 17:36:02 +0100 Subject: [PATCH] ui: storage: enable download-url button with Sys.AccessNetwork capability MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Now that the new Sys.AccessNetwork privilege got added to access-control and the storage download and manager query API endpoints, the UI should reflect that change and allow opening the dialogue to download an image from URL also for the users that are allowed to do so through the new privilege. Signed-off-by: Thomas Lamprecht Tested-by: Hannes Duerr Reviewed-by: Fabian Grünbichler --- www/manager6/storage/Browser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/manager6/storage/Browser.js b/www/manager6/storage/Browser.js index 457816a6..c2ad01e9 100644 --- a/www/manager6/storage/Browser.js +++ b/www/manager6/storage/Browser.js @@ -51,7 +51,10 @@ Ext.define('PVE.storage.Browser', { let contents = res.content.split(','); let enableUpload = !!caps.storage['Datastore.AllocateTemplate']; - let enableDownloadUrl = enableUpload && !!(caps.nodes['Sys.Audit'] && caps.nodes['Sys.Modify']); + let enableDownloadUrl = enableUpload && ( + !!(caps.nodes['Sys.Audit'] && caps.nodes['Sys.Modify']) || // for backward compat + !!caps.nodes['Sys.AccessNetwork'] // new explicit priv for querying (local) networks + ); if (contents.includes('backup')) { me.items.push({ -- 2.39.2