cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Portal Role of the Logged in User.

Former Member
0 Kudos

Hi Experts ,

I have a scenario similar to the one in following weblog:

/people/preksha.malhotra/blog/2006/12/12/accessing-a-web-dynpro-application-through-portal-using-portal-user-id

I need to know, if I can get the Portal "Role" of the user who has

looged in on the portal and then pass it as the application parameter

to the Web Dynpro application.

Also, if there is any other way to get the Portal Role of the user

in Web Dynpro, if EP and Web Dynpro are on different servers.

For the same server situation i have tried the following code which works:

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

}

Any help would be appreciated.

Thanx in Advance

Alka.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

role = rfact.getRole(roleName);

wdComponentAPI.getMessageManager().reportSuccess("Role:" + roleName

+ "Display Name:" + role.getDisplayName()

+ "ID: " + role.getUniqueID()

+ "Uniquename: " + role.getUniqueName()

+ "Description: " + role.getDescription());

<b>role.getDisplayName()</b> will gives you the Role Name.

Regards,

Jhansi

Former Member
0 Kudos

Hi Jhansi,

I had tried the getDisplayName() method. The others were useful too. Thanx for the reply.

But can you guide me with the separate server scenario for getting role names.

Regards,

Alka

Former Member
0 Kudos

Hi Alka,

sitting in front of the same problem here as you are facing. I have WD and portal on seperate servers and want to look for specific roles a user has (or not).

Did you find a solution? Or do you know if it is possible at all? I could imagine that the UMFactory is just looking at the server the WD is deployed to and not the portal server where it is displayed. The user is passed via SSO but the roles most probably not... (i guess?).

You could make my day if you have a solution though... ;).

Thanks,

Christian

Former Member
0 Kudos

Hi Christian,

I have yet not found the solution for getting the Portal Roles of the looged in user.

Going through the various forums, and the solutions proposed, I finally deployed

my Web Dynpro application on the Portal server and made it work.

Please notify me in case you find a solution for this.

Regards,

Alka.

Answers (1)

Answers (1)

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

follow the link, it will be of help to you

regards,

abhijeet

Former Member
0 Kudos

Hi Abhijeet,

You have misunderstood the problem. I don't require all the roles that are defined

on the Protal Server.

I need the Role of the User who has logged in on the Portal server.

Also the solution that You are trying to suggest will work only on same server scenario.

Anyways thanx for a prompt reply.

Alka.