cancel
Showing results for 
Search instead for 
Did you mean: 

To get the Roles, Worksets, iviews assigned to portal user using webdynpro

Former Member
0 Kudos

Hi..

I need to display the roles, worksets, pages and iviews that are assigned to a particular portal user using WebDynpro.

I tried to search in SDN and found a few blogs on this... but all are for DynPages. I could not find any inputs on how to achieve this in Webdynpro.

I am listing down the blogs for your reference :

1) /people/prakash.singh4/blog/2005/07/28/browse-roles-folders-pages-iviews-assigned-to-a-user-ep6-sp9-and-higher

2) /people/prakash.singh4/blog/2005/09/06/create-a-sitemap-for-your-portal

Please provide me your suggestions on how to display the roles, worksets, pages and iviews that are assigned to a particular portal user using WebDynpro.

Thanks and Regards,

Sayan Ghosh

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Vaibhav,

Thanks for the quick response. The method u said will fetch me the roles only. But how to fetch the assigned worksets and iviews along with that.. ?

Thanks and Regards,

Sayan Ghosh

Former Member
0 Kudos

closing thread...

Former Member
0 Kudos

Hi Pradeep,

Thanks for your quick response. The links and code that u specified are not related to webDynpro. I want a sample Webdynpro code to solve my requirement.

Thanks and Regards,

Sayan Ghosh

Former Member
0 Kudos

Please use following code to get all roles assigned to user:

IWDClientUser wdUser = WDClientUser.forceLoggedInClientUser();

IUser user = wdUser.getSAPUser();

String strRoleID = "", strRoleDesc = "";

IRoleFactory iRoleFactory;

iRoleFactory = UMFactory.getRoleFactory();

// Get All the Roles of the User

Iterator iteratorRoles = user.getRoles(true);//prtRequest.getUser().getRoles(true);

// Loop through all the Roles

while(iteratorRoles.hasNext())

{

strRoleID = iteratorRoles.next().toString();

try

{

strRoleDesc = iRoleFactory.getRole(strRoleID).getDescription();

wdComponentAPI.getMessageManager().reportSuccess("Role: "+strRoleDesc);

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException("Exception e: "+e, false);

}

}