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: Problem with Guest users permissions in embed Web form Portlet
Hi, there!In one of my projects ( running on liferay-ce-7.2-ga1 ) I need to embed the Web form Portlet into a web content template of a custom structure. Inside this template I need to switch between two types of existing forms based on a specific values of other fields set by content editors. So the idea is to embed the web form portlet and pass a specific formID as a conf parameter to the portlet. The embed code looks like that:
<#assign preferences = freeMarkerPortletPreferences.getPreferences( "formInstanceId", "XXXX" ) />
<@liferay_portlet["runtime"]
portletName="com_liferay_dynamic_data_mapping_form_web_portlet_DDMFormPortlet"
defaultPreferences="${preferences}"
instanceId="123"
/>
This code seems to work and I manage to see the embed portlet with the correct form, but I'm able to see this ok only if I am logged as Admin user. However, if I check it as a Guest user, then the form is blurred and I'm not able to do any action on it (click on a field or button inside it). Also I see the "Select form" link of the form portlet which should be invisible for guests in general.
Any idea what I'm doing wrong?
Regards,
Eli
<#assign preferences = freeMarkerPortletPreferences.getPreferences( "formInstanceId", "XXXX" ) />
<@liferay_portlet["runtime"]
portletName="com_liferay_dynamic_data_mapping_form_web_portlet_DDMFormPortlet"
defaultPreferences="${preferences}"
instanceId="123"
/>
This code seems to work and I manage to see the embed portlet with the correct form, but I'm able to see this ok only if I am logged as Admin user. However, if I check it as a Guest user, then the form is blurred and I'm not able to do any action on it (click on a field or button inside it). Also I see the "Select form" link of the form portlet which should be invisible for guests in general.
Any idea what I'm doing wrong?
Regards,
Eli
Hi,
I was able to reproduce the error you mentioned, this is due to Liferay.Session value is getting null for ddm form when not logged in , where ddm form is embedded onto webcontent . Instead of embedding may be u can render the form in custom portlet https://liferay.dev/blogs/-/blogs/liferay-form-in-custom-module.
I was able to reproduce the error you mentioned, this is due to Liferay.Session value is getting null for ddm form when not logged in , where ddm form is embedded onto webcontent . Instead of embedding may be u can render the form in custom portlet https://liferay.dev/blogs/-/blogs/liferay-form-in-custom-module.
Hi Mohammed and thanks for the reply!
I will give a try with the solution that you propose. Thank you once again!
Regards,
Eli
I will give a try with the solution that you propose. Thank you once again!
Regards,
Eli
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™