In our last post we created a new group. Now we’ll doing something truly exciting: We’ll add members to the group. Adding and removing members is the same Put request. The difference is we specify “Add” or “Remove” as the operation for each member. The sample client records values added and removed in code, and it computes the difference when constructing a Put request. You don’t have to track which users were added or removed.
In this example we will now add a user to the group created in the last post. The code:
- We don’t know the object ID of our created group so we first search for it. We send an enumeration filter for groups that match our display name. In production code multiple groups could have the same display name, so this filter will not necessarily return the group we want first. For our purposes, we hope you excuse the assumption.
- Once we have the group we check that the ExplicitMember attribute exists. This is a list of Person object IDs who are explicitly members of our group.
- Now we need the object ID of the person or persons to add. In our example we add everyone in ILM “2” RC to this group by enumerating all Person objects.
- To add a member to the group, you simply add another object ID to the multi-valued attribute.
- We put the copy of the group on the ILM Service. The put request is how you update objects. The sample client computes which members are new and only sends updates for those.
- To remove members you remove the object ID from the multi-valued attribute.
That’s it! We have successfully updated an existing object in ILM, and more importantly, we added members to our group.
You now have the building blocks to recreate much of the ILM “2” portal’s functionality. You can list users, filter for users in a particular group, create objects, and add members to a group. I hope this initial tour has been useful and fruitful for you. Thank you for following along and providing useful feedback. We are ever excited to release ILM “2”. After the winter hiatus we will continue on with different extensibility scenarios in ILM “2”. Happy exploring!