correctly compute GUI capabilities (consider pools)

This commit is contained in:
Dietmar Maurer 2012-05-30 08:47:43 +02:00
parent 5bb4e06a64
commit 437be042c2
3 changed files with 20 additions and 4 deletions

View File

@ -2,7 +2,7 @@ RELEASE=2.1
VERSION=1.0 VERSION=1.0
PACKAGE=libpve-access-control PACKAGE=libpve-access-control
PKGREL=22 PKGREL=23
DESTDIR= DESTDIR=
PREFIX=/usr PREFIX=/usr

View File

@ -151,12 +151,22 @@ my $compute_api_permission = sub {
dc => {}, dc => {},
}; };
foreach my $vmid (keys %$idlist, '__phantom__') { my $extract_vm_caps = sub {
my $perm = $rpcenv->permissions($authuser, "/vms/$vmid"); my ($path) = @_;
my $perm = $rpcenv->permissions($authuser, $path);
foreach my $priv (keys %$perm) { foreach my $priv (keys %$perm) {
next if !($priv eq 'Permissions.Modify' || $priv =~ m/^VM\./); next if !($priv eq 'Permissions.Modify' || $priv =~ m/^VM\./);
$res->{vms}->{$priv} = 1; $res->{vms}->{$priv} = 1;
} }
};
foreach my $pool (keys %{$usercfg->{pools}}) {
&$extract_vm_caps("/pool/$pool");
}
foreach my $vmid (keys %$idlist, '__phantom__') {
&$extract_vm_caps("/vms/$vmid");
} }
foreach my $storeid (@sids, '__phantom__') { foreach my $storeid (@sids, '__phantom__') {

View File

@ -1,3 +1,9 @@
libpve-access-control (1.0-23) unstable; urgency=low
* correctly compute GUI capabilities (consider pools)
-- Proxmox Support Team <support@proxmox.com> Wed, 30 May 2012 08:47:23 +0200
libpve-access-control (1.0-22) unstable; urgency=low libpve-access-control (1.0-22) unstable; urgency=low
* new plugin architecture for Auth modules, minor API change for Auth * new plugin architecture for Auth modules, minor API change for Auth