LPS-50325 & LPS-50661

Per BChan, need this committed in order to backport LSV security issue.
https://github.com/brianchandotcom/liferay-portal-ee/pull/7482