Posted on 16/08/2018 16:00:45
Hi Jens
I am affraid you cannot - simple anyways. Users can be in many groups - so that would potentially give the same users many times.
You can create a group structure in Razor you can use the AllGroups loop and look at the UserManagement:Group.ID and the UserManagement:Group.ParentID tags to create the tree structure using a dictionary and some rendering logic.
You can use the API to get users in a group. So in the groups loop, create an instance of Dynamicweb.Security.UserManagement.Group using the groupid - and then call the Users property :
https://doc.dynamicweb.com/Default.aspx?ID=8258#article=fb8104ba-1f1f-2e8d-8f33-3afcecb5d39e
Be careful about performance as this is a lazy call on the database.
BR Nicolai