[pve-devel] [PATCH manager 1/1] fix #3402: add Pool.Audit permission
Lorenz Stechauner
l.stechauner at proxmox.com
Thu Apr 29 11:49:07 CEST 2021
Signed-off-by: Lorenz Stechauner <l.stechauner at 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
More information about the pve-devel
mailing list