cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the Role of the logged in User?

Former Member
0 Kudos

Hi All,

Enclosed below is the code am trying to use to get the role for a logged in portal user. But it fails

1. Due to class path errors although I have imported the necessary jar files.

2. Am unable to invoke/find getSAPUser() method or invoke the UMFactory.

Iterator rit = null;

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);

wdContext.currentContextElement().setRole(role);

}

What could be the problem and what are the jars that need to imported as I am using EP7.0

Thanks for all your help in advance.

Best regards,

Divya

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Divya,

Add WD_RUNTIME/com.sap.security/lib/com.sap.security.api.jar to your project`s java build path.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim,

Thanks a ton for this one! It solved the problem.

Cheers

Divya

Answers (0)