RE: Display different Iframe for Guest and for Registered users

Gabriel Nemeth, modified 6 Years ago. New Member Post: 1 Join Date: 11/7/18 Recent Posts

Hi all,

 

What I want to achieve:

  • display one iframe for guest users only
  • on the same page display another iframe for logged in users only

Sounds easy, but it's not. The problem is, even if I check the permission for the first iframe to be visible only for guests, it displays also for logged in users. I guess this is because the logged in users inherits permissions from guest users.

 

I found one workaround  for the permissions, simply put permissions.check.guest.enabled=false inside portal-ext.properties. Everything is working fine, the iframes are displaying as intended, but here comes the funny part. Now my logged in user can't log out, since he don't have permissions for that. Now I tried for 2 days different combination of permissions to display the user bar on the top and the user menu on the left to enable for users to log out without success. At this point I'm really frustrated, that I can't set up a primitive scenario like this in liferay.

thumbnail
Amos Fong, modified 6 Years ago. Liferay Legend Posts: 2047 Join Date: 10/7/08 Recent Posts

Yea, you're right, the users will inherit permissions from guest. I've seen this question asked before in the forums, but can't find it now.

 

Is your iframe in a web content? The simplest way is probably to create a web content template which shows different content if the user is signed in or not.