]> git.proxmox.com Git - pve-access-control.git/commitdiff
use User.Allocate instead of User.Add/User.Delete
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 26 Jan 2012 07:26:31 +0000 (08:26 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 26 Jan 2012 07:26:31 +0000 (08:26 +0100)
PVE/API2/Group.pm
PVE/API2/User.pm
PVE/AccessControl.pm

index ddea3dc3e7f2f93cba80b356f49fa8363e2b1d4c..b3cc15e91f6f30a1e02712cbb308bda8e40feabe 100644 (file)
@@ -34,7 +34,7 @@ __PACKAGE__->register_method ({
     method => 'GET',
     description => "Group index.",
     permissions => { 
-       description => "The returned list is restricted to groups where you have 'User.Add' or 'Sys.Audit' permissions on '/access', or 'User.Add' on /access/groups/<group>.",
+       description => "The returned list is restricted to groups where you have 'User.Allocate' or 'Sys.Audit' permissions on '/access', or 'User.Allocate' on /access/groups/<group>.",
        user => 'all',
     },
     parameters => {
@@ -60,7 +60,7 @@ __PACKAGE__->register_method ({
        my $usercfg = cfs_read_file("user.cfg");
        my $authuser = $rpcenv->get_user();
 
-       my $privs = [ 'User.Add', 'Sys.Audit' ];
+       my $privs = [ 'User.Allocate', 'Sys.Audit' ];
        my $allow = $rpcenv->check_any($authuser, "/access", $privs, 1);
        syslog("info", "TEST $allow");
        my $allowed_groups = $rpcenv->filter_groups($authuser, $privs, 1);
index aa88dfd72f4898524e8e407aada6230ccd61311f..6f4aff1c84b19baa9c6218d0bb7e926f3c95a7fb 100644 (file)
@@ -38,7 +38,7 @@ __PACKAGE__->register_method ({
     method => 'GET',
     description => "User index.",
     permissions => { 
-       description => "The returned list is restricted to users where you have 'User.Modify' or 'User.Delete' permissions on '/access' or on a group the user belongs too. But it always includes the current (authenticated) user.",
+       description => "The returned list is restricted to users where you have 'User.Modify' or 'User.Allocate' permissions on '/access' or on a group the user belongs too. But it always includes the current (authenticated) user.",
        user => 'all',
     },
     parameters => {
@@ -70,7 +70,7 @@ __PACKAGE__->register_method ({
 
        my $res = [];
 
-       my $privs = [ 'User.Modify', 'User.Delete' ];
+       my $privs = [ 'User.Modify', 'User.Allocate' ];
 
        my $canUserMod = $rpcenv->check_any($authuser, "/access", $privs, 1);
        my $groups = $rpcenv->filter_groups($authuser, $privs, 1);
@@ -102,8 +102,8 @@ __PACKAGE__->register_method ({
     path => '', 
     method => 'POST',
     permissions => { 
-       description => "You need 'User.Add' permissions to '/access/groups/<group>' for any group specified, or 'User.Add' on '/access' if you pass no groups.",
-       check => ['userid-group', ['User.Add'], groups_param => 1],
+       description => "You need 'User.Allocate' permissions to '/access/groups/<group>' for any group specified, or 'User.Allocate' on '/access' if you pass no groups.",
+       check => ['userid-group', ['User.Allocate'], groups_param => 1],
     },
     description => "Create new user.",
     parameters => {
@@ -302,7 +302,7 @@ __PACKAGE__->register_method ({
     method => 'DELETE',
     description => "Delete user.",
     permissions => { 
-       check => ['userid-group', ['User.Delete']],
+       check => ['userid-group', ['User.Allocate']],
     },
     parameters => {
        additionalProperties => 0,
index 6afe65cdae7c542e659b07a7372f28030ea38bc5..ee731d8aa457ddd4b564127694df1e78011590ad 100644 (file)
@@ -566,10 +566,11 @@ my $privgroups = {
     },
     Datastore => {
        root => [
-           'Datastore.Allocate',
            'Permissions.Modify',
        ],
-       admin => [],
+       admin => [
+           'Datastore.Allocate',
+       ],
        user => [
            'Datastore.AllocateSpace',
        ],
@@ -578,14 +579,11 @@ my $privgroups = {
        ],
     },
     User => {
-       root => [
-
-           ],
+       root => [],
        admin => [
            'User.Modify',
-           'User.Add',
-           'User.Delete',
-           ],
+           'User.Allocate',
+       ],
        user => [],
        audit => [],
     },