]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/API2/Group.pm
API: add group members to group index
[pve-access-control.git] / PVE / API2 / Group.pm
index 1d6ba98bf605da4a3004bb9aae850358d1af7bd3..c463bd6a1fd0ce23340acc2f36d8b7f7f291f1af 100644 (file)
@@ -13,7 +13,6 @@ use base qw(PVE::RESTHandler);
 register_standard_option('group-id', {
     type => 'string',
     format => 'pve-groupid',
-    title => 'Group ID' ,
     completion => \&PVE::AccessControl::complete_group,
 });
 
@@ -39,6 +38,12 @@ __PACKAGE__->register_method ({
            properties => {
                groupid => get_standard_option('group-id'),
                comment => get_standard_option('group-comment'),
+               users => {
+                   type => 'string',
+                   format => 'pve-userid-list',
+                   optional => 1,
+                   description => 'list of users which form this group',
+               },
            },
        },
        links => [ { rel => 'child', href => "{groupid}" } ],
@@ -59,6 +64,7 @@ __PACKAGE__->register_method ({
            my $data = $usercfg->{groups}->{$group};
            my $entry = { groupid => $group };
            $entry->{comment} = $data->{comment} if defined($data->{comment});
+           $entry->{users} = join (',', sort keys %{$data->{users}}) if defined($data->{users});
            push @$res, $entry;
        }