I want to assign UME roles that I have created in portal NW 7.3 to users present in the portal using java.
Kindly help me regarding the code how to assign the particular role to the user..
I foung the Procedure but is there any code already available.
- Use the IUser and IRole interfaces to get the user and role objects.
- Check if the user is already directly assigned a member of the role or not.This is to avoid AttributeValueAlreadyExistsException . You cannot avoid this risk completely. There is the remote possibility that another application makes the same role assignment in the time between this check and the actual role assignment.
- Use the getMutableRole() method to get a modifiable version of the role object.
- Use the addMember() method to assign the user to the role.
- Commit your changes.