Tuesday, March 16, 2010

SAP Portal - Obtain IUser from IResource

Add com.sap.portal.usermanagement/lib/com.sap.security.api.ep5.jar to classpath.

then,
IResource resource = ...;
IResourceContext context = resource.getContext();
IUser user = context.getUser();
IUser is deprecated since it is a EP5 user. However, UME user is not available for KM. So, no choice.

By the way, to obtain the Locale
Locale locale = context.getLocale()

No comments: