WW-4963 Implements new PrincipalAware interface

that uses withPrincipalProxy instead of setPrincipalProxy
This commit is contained in:
Lukasz Lenart
2018-09-25 08:10:36 +02:00
parent dc7138ee2e
commit 384d418039
5 changed files with 115 additions and 0 deletions
@@ -61,6 +61,12 @@ public class PortletAwareInterceptor extends AbstractInterceptor implements Stru
PortletRequest request = (PortletRequest) context.get(PortletConstants.REQUEST);
((PrincipalAware) action).setPrincipalProxy(new PortletPrincipalProxy(request));
}
if (action instanceof org.apache.struts2.action.PrincipalAware) {
PortletRequest request = (PortletRequest) context.get(PortletConstants.REQUEST);
((org.apache.struts2.action.PrincipalAware) action).withPrincipalProxy(new PortletPrincipalProxy(request));
}
if (action instanceof PortletContextAware) {
PortletContext portletContext = (PortletContext) context.get(StrutsStatics.STRUTS_PORTLET_CONTEXT);
((PortletContextAware) action).setPortletContext(portletContext);