Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to add an impersonation listener in Liferay DXP ?
We have some logic to perform when an authorized user ends impersonating a site user. From my understanding, the 'be yourself again' link in the product menu to end impersonation should be the place to override. The JSP file is found inside the "liferay-portal/modules/apps/web-experience/product-navigation/product-navigation-user/src/main/resources/META-INF/resources/user_body.jsp" . Is this the right approach to solve this issue?
Thanks!
Thanks!
You can't rely on a user clicking "be yourself again". After all, when you impersonate you typically get a separate tab or window as the user, so often times I just close that tab and go back to my original.
It is just like you cannot depend upon users logging out. They may expire due to being idle, they might have just driven into a tunnel losing network connectivity, ...
And "be yourself again" I don't believe it triggers any sort of event like starting impersonation does...
It is just like you cannot depend upon users logging out. They may expire due to being idle, they might have just driven into a tunnel losing network connectivity, ...
And "be yourself again" I don't believe it triggers any sort of event like starting impersonation does...
Thanks David. I have to figure out some other ways to do that
Like I said, you can't rely on that link, there are zero guarantees that anyone would use it...
ok, I got it.
Hi David, After peer discussion about your answer, it came up that we don't need to address the scenarios of ending impersonation other than clicking the 'be yourself again' link. So, we need to override the 'user_body.jsp' to add our custom logic. However, examples shown in the liferay documentations are showing JSP overriding inside '/portal-web/docroot/html' folder. Can we use the same way to override this 'user_body.jsp' inside "liferay-portal/modules/apps/web-experience/product-navigation/product-navigation-user/src/main/resources/META-INF/resources".
David H Nebinger:
Like I said, you can't rely on that link, there are zero guarantees that anyone would use it...
No, for that one you need a fragment bundle to override the JSP.
Thank you so much. It worked!
David H Nebinger:
No, for that one you need a fragment bundle to override the JSP.