From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 6ACCC77E63 for ; Thu, 29 Apr 2021 11:49:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5D1C719499 for ; Thu, 29 Apr 2021 11:49:10 +0200 (CEST) Received: from dana.proxmox.com (unknown [94.136.29.99]) by firstgate.proxmox.com (Proxmox) with ESMTP id DB3E919490 for ; Thu, 29 Apr 2021 11:49:09 +0200 (CEST) Received: by dana.proxmox.com (Postfix, from userid 10037) id CC4E41C33E8; Thu, 29 Apr 2021 11:49:09 +0200 (CEST) From: Lorenz Stechauner To: pve-devel@lists.proxmox.com Date: Thu, 29 Apr 2021 11:49:07 +0200 Message-Id: <20210429094907.51883-1-l.stechauner@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210429094812.51587-1-l.stechauner@proxmox.com> References: <20210429094812.51587-1-l.stechauner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 2 AWL 0.093 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.379 Envelope sender has no MX or A DNS records RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pool.pm, cluster.pm] Subject: [pve-devel] [PATCH manager 1/1] fix #3402: add Pool.Audit permission X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:49:40 -0000 Signed-off-by: Lorenz Stechauner --- PVE/API2/Cluster.pm | 2 +- PVE/API2/Pool.pm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm index ab5b28a1..ace5b5b1 100644 --- a/PVE/API2/Cluster.pm +++ b/PVE/API2/Cluster.pm @@ -332,7 +332,7 @@ __PACKAGE__->register_method({ for my $pool (sort keys %{$usercfg->{pools}}) { my $d = $usercfg->{pools}->{$pool}; - next if !$rpcenv->check($authuser, "/pool/$pool", [ 'Pool.Allocate' ], 1); + next if !$rpcenv->check($authuser, "/pool/$pool", [ 'Pool.Audit' ], 1); my $entry = { id => "/pool/$pool", diff --git a/PVE/API2/Pool.pm b/PVE/API2/Pool.pm index 567c7e8d..6ef981fb 100644 --- a/PVE/API2/Pool.pm +++ b/PVE/API2/Pool.pm @@ -23,7 +23,7 @@ __PACKAGE__->register_method ({ method => 'GET', description => "Pool index.", permissions => { - description => "List all pools where you have Pool.Allocate or VM.Allocate permissions on /pool/.", + description => "List all pools where you have Pool.Audit or VM.Allocate permissions on /pool/.", user => 'all', }, parameters => { @@ -51,7 +51,7 @@ __PACKAGE__->register_method ({ my $usercfg = $rpcenv->{user_cfg}; foreach my $pool (keys %{$usercfg->{pools}}) { - next if !$rpcenv->check_any($authuser, "/pool/$pool", [ 'Pool.Allocate', 'VM.Allocate' ], 1); + next if !$rpcenv->check_any($authuser, "/pool/$pool", [ 'Pool.Audit', 'VM.Allocate' ], 1); my $entry = { poolid => $pool }; my $data = $usercfg->{pools}->{$pool}; @@ -202,7 +202,7 @@ __PACKAGE__->register_method ({ path => '{poolid}', method => 'GET', permissions => { - check => ['perm', '/pool/{poolid}', ['Pool.Allocate']], + check => ['perm', '/pool/{poolid}', ['Pool.Audit']], }, description => "Get pool configuration.", parameters => { -- 2.20.1