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",
$entry->{lock} = $lock;
}
+ if (defined($entry->{pool}) &&
+ !$rpcenv->check($authuser, "/pool/$entry->{pool}", ['Pool.Audit'], 1)) {
+ delete $entry->{pool};
+ }
+
# get ha status
if (my $hatype = $hatypemap->{$entry->{type}}) {
my $sid = "$hatype:$vmid";
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 permissions on /pool/<pool>.",
user => 'all',
},
parameters => {
my $usercfg = $rpcenv->{user_cfg};
+
my $res = [];
for my $pool (sort keys %{$usercfg->{pools}}) {
- next if !$rpcenv->check_any($authuser, "/pool/$pool", [ 'Pool.Allocate', 'VM.Allocate' ], 1);
+ next if !$rpcenv->check($authuser, "/pool/$pool", [ 'Pool.Audit' ], 1);
my $entry = { poolid => $pool };
my $pool_config = $usercfg->{pools}->{$pool};
path => '{poolid}',
method => 'GET',
permissions => {
- check => ['perm', '/pool/{poolid}', ['Pool.Allocate']],
+ check => ['perm', '/pool/{poolid}', ['Pool.Audit']],
},
description => "Get pool configuration.",
parameters => {
my $pool = $res->{pool};
if (defined($pool) &&
- !$rpcenv->check($authuser, "/pool/$pool", ['Pool.Allocate'], 1)) {
+ !$rpcenv->check($authuser, "/pool/$pool", ['Pool.Audit'], 1)) {
delete $res->{pool};
}