Cannot Request Users With long userid After Patching to DE-93

Issue

  • We use this code to secure our API calls in our customization:
    (request variable is an HttpServletRequest object from @Context annotation)

    long userId = GetterUtil.getLong(request.getRemoteUser()); 
    user = UserLocalServiceUtil.getUser(userId);
  • However, after patching to DE-93 from DE-59 this code only calls default Liferay user. Because of this, users can't log in after applying the patch.

Environment

  • DXP 7.0

Resolution

  • In this case, it is resolved by using the PortalUtil class PortalUtil.getUser(HttpServletRequest request) Liferay API

Additional Information

 

这篇文章有帮助吗?
0 人中有 0 人觉得有帮助