public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 2/2] ui: storage: enable download-url button with Sys.AccessNetwork capability
Date: Mon, 19 Feb 2024 18:14:12 +0100	[thread overview]
Message-ID: <20240219171412.1576651-5-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20240219171412.1576651-1-t.lamprecht@proxmox.com>

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>
---
 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





  parent reply	other threads:[~2024-02-19 17:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 17:14 [pve-devel] fix #5254: add separate Sys.AccessNetwork privilege Thomas Lamprecht
2024-02-19 17:14 ` [pve-devel] [PATCH access-control] add " Thomas Lamprecht
2024-02-19 17:14 ` [pve-devel] [PATCH storage:] fix #5254: api: allow usage of download-url with Sys.AccessNetwork Thomas Lamprecht
2024-02-19 17:14 ` [pve-devel] [PATCH manager 1/2] api: nodes: allow usage of query url metadata " Thomas Lamprecht
2024-02-19 17:14 ` Thomas Lamprecht [this message]
2024-02-19 17:25 ` [pve-devel] fix #5254: add separate Sys.AccessNetwork privilege Thomas Lamprecht
2024-02-20 15:51 ` Hannes Dürr
2024-02-23 10:21 ` Fabian Grünbichler
2024-02-28 14:55 ` [pve-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240219171412.1576651-5-t.lamprecht@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal