]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: storage: enable download-url button with Sys.AccessNetwork capability
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 19 Feb 2024 16:36:02 +0000 (17:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Feb 2024 14:53:28 +0000 (15:53 +0100)
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 <t.lamprecht@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
www/manager6/storage/Browser.js

index 457816a68a617fe82025e14ccb3e97a2ad17fe6e..c2ad01e9e052ffbeeff81ee9eade4e1c722fb75d 100644 (file)
@@ -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({