LPS-27013

Fix browser redirect loop, if the guest user is accessing staging page and if the guest user does not have permission to Layout. Extend permission check also for sign-in users.

Code has been commented at following commits:
https://github.com/sammso/liferay-portal/commit/4110a6271ddc35cc56f09494845e9bb3fe803da3
https://github.com/sammso/liferay-portal/commit/1ad5f37bd91e8ea2f235b8f7f43c2f8c37a49835