[pve-devel] [PATCH v3 access-control 17/20] API: add group members to group index

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Jan 21 13:54:15 CET 2020


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
see corresponding patch in pve-manager

 PVE/API2/Group.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/API2/Group.pm b/PVE/API2/Group.pm
index 37f8be2..c463bd6 100644
--- a/PVE/API2/Group.pm
+++ b/PVE/API2/Group.pm
@@ -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;
 	}
 
-- 
2.20.1





More information about the pve-devel mailing list