cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing portal roles in webdynpro for java

Former Member
0 Kudos

Hi,

Please let me know how to access portal roles in webdynpro for java.

Rgds,

Patana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Check these wiki pages for more:

https://wiki.sdn.sap.com/wiki/display/WDJava/DynamicRoleAssignmentinportalusingwebdynpro+application

https://wiki.sdn.sap.com/wiki/display/HOME/Toretreiveuser%27sdatafromUMElikeGroups%2CRoles.

Answers (1)

Answers (1)

pravesh_verma
Active Contributor
0 Kudos

Hi ,

Please use this API to access the portal roles:


IRoleFactory fact=UMFactory.getRoleFactory();

Also see this code to get more information of role using code:


IRoleFactory rolef=UMFactory.getRoleFactory();
IRoleSearchFilter searchfilterrole= rolef.getRoleSearchFilter();
ISearchResult searchResult = rolef.searchRoles(searchfilterrole);

while(searchResult.hasNext())
{
 
String unq=(String) searchResult.next();
IRole role1=rolef.getRole(unq);
String roleName = role1.getDisplayName();
String roleID = role1.getUniqueID();
// Once you get the informationof role you can use it in your application as per your requirement.

}

Also please note that:

You should add "com.sap.security.api.jar" to your project`s java build path for getting the Portal Security API's.

I hope this solves the problem. Please revert back incase you need any further informationon this.

Thanks and Regards,

Pravesh