]> git.proxmox.com Git - pve-access-control.git/commitdiff
API: add group members to group index
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 21 Jan 2020 12:54:15 +0000 (13:54 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 28 Jan 2020 19:56:55 +0000 (20:56 +0100)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/API2/Group.pm

index 37f8be24645e204e11dc012d1feb798ac8184cd1..c463bd6a1fd0ce23340acc2f36d8b7f7f291f1af 100644 (file)
@@ -38,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}" } ],
@@ -58,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;
        }