Get portal node of current web dynpro application
I have a requirement to identify the logged on user's role of the web dynpro application, then show different contents to them, e.g. different contents to requestor and approver.
We can use the API "WDClientUser.forceLoggedInClientUser().getSAPUser().getParentGroups(true)" to get user's portal roles but the problem is one user may have both requestor and approver roles assigned. So we need to get the portal node which this web dynpro application is positioned. i.e. did he click "Request Page" or "Approval Page" to launch the web dynpro application.
Thread Get current portal role that the application running underneath suggests using sharing reference of portal services. But we're now using CE7.1 EhP1 and sharing reference is deprecated. Anyone knows what else we can do to get the portal nodes?
Piyas Kumar Das replied
the code given bellow gives you the current clicked role,ir the role u have clicked on currently
IWDNavigationHelperService wdNavHelperService =
INavigationNode navigationNode = wdNavHelperService.getCurrentNavNode();
String navNode = navigationNode.getName();
to use this code successfully add com.sap.portal.navigation.sec_help_service.api
& tc.ep.navigation.api in Component Properties Dependency Tab
Piyas Kumar Das