cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning Users to Roles in NW 7.3 J2EE JAVA

Former Member
0 Kudos
102

Hello All,

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.

Procedure

  1. Use the IUser and IRole interfaces to get the user and role objects.
  2. 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.
  3. Use the getMutableRole() method to get a modifiable version of the role object.
  4. Use the addMember() method to assign the user to the role.
  5. Commit your changes.

Accepted Solutions (0)

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

Somehow the actual code example has been lost in the NW 7.3 documentation. However, it's the same as in 7.0 so this should help: Assigning Users to Roles - Integrating Security Functions - SAP Library

--Vlado