cancel
Showing results for 
Search instead for 
Did you mean: 

How to Disply the List of Roles assigned to a selected user ?

Former Member
0 Kudos

Hi all,

I have a specific requirement to develope using Webdynpro. I want to programically display the list of roles assigned to a selected user. Could some one help me . I promise to award points for the solution.

Thank you in advance

Regards

Maruti

Accepted Solutions (1)

Accepted Solutions (1)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Maruti,

Iterator rit = null;

try

{

IWDClientUser clientUser = WDClientUser.getCurrentUser();

IUser user = clientUser.getSAPUser();

rit = user.getRoles(true);

IRoleFactory rfact = UMFactory.getRoleFactory();

while (rit.hasNext()) {

String roleName = (String) rit.next();

IRole role = rfact.getRole(roleName);

}

}catch(Exception e)

{

e.getLocalizedMessage();

}

check this thread too

/message/1565111#1565111 [original link is broken]

Regards, Suresh KB

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Maruti,

You need to add something called com.sap.security.api.jar file to the library of your project(It will be in SAP\JDT\eclipse\plugins folder). when you want access the UME APIs.

See this link for UME APIs

https://media.sdn.sap.com/javadocs/NW04/SPS15/um/index.html

Regards, Suresh KB

Former Member
0 Kudos

Hi Suresh,

Thank you so much. I have solved the problem.

I have awarded the complete points

Cheers

Maruti

Answers (0)