]> git.proxmox.com Git - pve-access-control.git/commitdiff
correctly compute GUI capabilities (consider pools)
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 30 May 2012 06:47:43 +0000 (08:47 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 30 May 2012 06:47:43 +0000 (08:47 +0200)
Makefile
PVE/API2/AccessControl.pm
changelog.Debian

index 04bc297905e77e2a74b9ed1f39fc092ca6e0b1de..bbea6a90dd5db376dde9fd1ce97d7674e848c003 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ RELEASE=2.1
 
 VERSION=1.0
 PACKAGE=libpve-access-control
 
 VERSION=1.0
 PACKAGE=libpve-access-control
-PKGREL=22
+PKGREL=23
 
 DESTDIR=
 PREFIX=/usr
 
 DESTDIR=
 PREFIX=/usr
index 141bc44831a61c5f55a3a3e6f3ff6c0965d78cb1..1679ed45eb4c0d6ff81682eb967fbce3c5521cfd 100644 (file)
@@ -151,12 +151,22 @@ my $compute_api_permission = sub {
        dc => {},
     };
 
        dc => {},
     };
 
-    foreach my $vmid (keys %$idlist, '__phantom__') {
-       my $perm = $rpcenv->permissions($authuser, "/vms/$vmid");
+    my $extract_vm_caps = sub {
+       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__') {
index d48eba0f7704567481f0433750e3ffa4412366fb..6d442f36d37f2ea77c99951c04a216fe65e81c3c 100644 (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
 
   * new plugin architecture for Auth modules, minor API change for Auth
 libpve-access-control (1.0-22) unstable; urgency=low
 
   * new plugin architecture for Auth modules, minor API change for Auth