Add a user to a group

Product version:
6.5, 6.4, 6.3, 6.2, 6.1, 6.0
Product edition:
  • Community
  • Teamwork
  • Efficiency
  • Performance

This example shows how to add a user to a group.

The user, group, and role are already defined, and each one is specified by ID. Note that it is not possible to add a user without a role.

final IdentityAPI identityAPI = new IdentityAccessor().getIdentityAPI(apiSession);
UserMembership membership = identityAPI.addUserMembership(userId, groupId, roleId);
The content of this page is for authenticated users only.

Last update on Feb, 17 2015