I am having issues defining the members of a group on sensenet using the .NET API SenseNet.Client.
I need to create an automatic process to add users and groups on sensenet. I know how to create the users and groups, but I didn't find any information about adding users to group.
Here's the code that I use to create a group:
var group = Content.CreateNew("/Root/IMS/BuiltIn/OUtest", "Group", "testGroup");
group["Name"] = "testGroup";
group["DisplayName"] = "testGroup";
await group.SaveAsync();
To support this scenario, there is a Group class in the Client API that contains a couple of methods for modifying group membership. It inherits from the main Content class, so it has all its features.
If you already have a group id, you may choose the static API for modifying membership (the idArray below should contain new members only, you dot have to know existing members, this is only the 'delta').
...or the instance API, if you are creating a new Group (note the generic creator method):
The methods above make the REST calls immediately, so there is no need to call Save after them.