public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lorenz Stechauner <l.stechauner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 1/1] fix #3402: add Pool.Audit permission
Date: Thu, 29 Apr 2021 11:49:07 +0200	[thread overview]
Message-ID: <20210429094907.51883-1-l.stechauner@proxmox.com> (raw)
In-Reply-To: <20210429094812.51587-1-l.stechauner@proxmox.com>

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
---
 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/<pool>.",
+	description => "List all pools where you have Pool.Audit or VM.Allocate permissions on /pool/<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




  parent reply	other threads:[~2021-04-29  9:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29  9:48 [pve-devel] SPAM: [PATCH-SERIES access-contorl/manager] " Lorenz Stechauner
2021-04-29  9:48 ` [pve-devel] [PATCH access-control 1/1] " Lorenz Stechauner
2021-04-30 11:27   ` Fabian Grünbichler
2021-04-29  9:49 ` Lorenz Stechauner [this message]
2021-04-30 11:27   ` [pve-devel] [PATCH manager " Fabian Grünbichler

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=20210429094907.51883-1-l.stechauner@proxmox.com \
    --to=l.stechauner@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