Forums de discussion

Why Liferay.PortletURL.createRenderURL() is not working for user role?

Gwowen Fu, modifié il y a 9 années.

Why Liferay.PortletURL.createRenderURL() is not working for user role?

Expert Publications: 315 Date d'inscription: 27/12/10 Publications récentes
Hello,

Have problem in EE 6.1. Works fine for CE 6.1.

I have the following function to create render URL for web content, it works for user with admin role but not working for "user" role. The whitelist has 56_INSTANCE_0000 and portlet.url.generate.by.path.enabled is set to "true".

Is there a setting that will restrict only user without admin role not able to use Liferay.PortletURL.createRenderURL()?

Liferay.provide(Liferay.myfunc, 'getURL', function() {
    var A = AUI();

    var url = Liferay.PortletURL.createRenderURL();
    url.setPortletId("56");
    url.setWindowState('EXCLUSIVE');
    url.setParameter("_56_groupId", themeDisplay.getCompanyGroupId());
    url.setParameter("_56_articleId", 7754201);

    console.log(url.toString());
    
  }, ['aui-base', 'aui-dialog', 'liferay-portlet-url']
);


Thank you!
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Why Liferay.PortletURL.createRenderURL() is not working for user role?

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
What service pack in EE 6.1?

Also you should be contacting support for EE issues. You are paying for that support, so you should use it as much as possible.
Gwowen Fu, modifié il y a 9 années.

RE: Why Liferay.PortletURL.createRenderURL() is not working for user role?

Expert Publications: 315 Date d'inscription: 27/12/10 Publications récentes
Hi David,

Thanks for your response.

We are using Liferay EE 6.1.20 (Paton / Build 6120 / July 31, 2012) from Ellucian. I haven't got my support account from them yet, so I posted question here.

In the portlet-ext.properties, there is a comment for portlet.url.generate.by.path.enabled property.
# Liferay LSV 2 Security Path
portlet.url.generate.by.path.enabled=false 


I wasn't able to call createRenderURL() for any user at first, after I set that property to true then admin user is able to use it.

I got "Provisional headers are shown" from Chrome and HTTP 401 from Firefox. Which module of Liferay source code (I only have CE source code) could I investigate to learn more about how client request is rejected by Liferay server?

Thank you!
Gwowen
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Why Liferay.PortletURL.createRenderURL() is not working for user role?

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
I don't think 6.1.20 is descriptive enough, you need to know what GA release and what service pack you have. For example, the latest is referred to as "GA 3 SP 4", but I don't know what numerical release that is (and often the service packs don't affect the version number anyway).

But if you're on Ellucian they may be handling things differently. Honestly I'm not familiar with the Ellucian platform and their Liferay integration, how the Liferay service packs may or may not impact Ellucian, etc.

The CE and EE cores are quite similar in their functionality, they just tend to diverge around the enterprise elements (clustering support, search appliance integration, SSO solutions, etc.).

The reason I asked about version, though, is usually the first recommendation (in fact the first response from Liferay support would be) is to update to the latest service pack and try again. The service packs have many fixes in them and, if you're not at the latest version, this will be the first step taken.
Gwowen Fu, modifié il y a 9 années.

RE: Why Liferay.PortletURL.createRenderURL() is not working for user role?

Expert Publications: 315 Date d'inscription: 27/12/10 Publications récentes
Hi David,

Thanks again for the information. In order to move on, I am going to build the URL from web services using Service Builder. The problem now is "how could I build the portlet URL without request object that is required by PortletURLFactoryUtil.create() function?". I will create a new thread for this question.

Best Regards,