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.