webContent for a given role in Liferay 7

thumbnail
Ramalingaiah. D, modified 7 Years ago. Expert Posts: 489 Join Date: 8/16/14 Recent Posts

Hi,

 

1down votefavorite

I want to create web contents that can't be visualized by a given role.

For example let's say I have the roles normal-user and plus-user. I want to create a Web Content that only plus-user's can see.

If I create a WebContent and enable the "View" permissions on it only for the plus-user and display this WebContent in a WebContent display portlet, normal-user's can view it. Is this the expected behaviour? I have disable the default View permission for every role, even the the default guest role.

I must be missing something because I believe this should be a pretty standard and obvious feature.

Thanks

Update Well it seems that I was misunderstanding the way how I could observe the effects of my changes.

It seems that the configuration that I've described works. Although, the web content is hidden only when listing web contents with the Web Content List portlet. If I set individually a Web Content Display portlet to show the private content, any role will be able to see it, even if it hasn't permission. The same happens If I share the URL to the web content.

So my question now is: Ignoring view permissions is the default behaviour for the Web Content Display portlet? With Asset Publisher portlet this doesn't happen. The web content is hidden when listing and viewing if the role hasn't view permissions on that content.

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Ramalingaiah. D:

So my question now is: Ignoring view permissions is the default behaviour for the Web Content Display portlet? With Asset Publisher portlet this doesn't happen. The web content is hidden when listing and viewing if the role hasn't view permissions on that content.

Yes, it's the default behavior for the web content display portlet. In 6.x and earlier versions of Liferay, this was governed by the portal property journal.article.view.permission.check.enabled. In 7.x and later versions of Liferay, this is governed by adding a configuration for the com.liferay.journal.configuration.JournalServiceConfiguration configuration (you can add .cfg as a file extension and drop it in osgi/configs, or you can use the Control Panel) and setting the value articleViewPermissionsCheckEnabled.

thumbnail
Ramalingaiah. D, modified 7 Years ago. Expert Posts: 489 Join Date: 8/16/14 Recent Posts

Hi Minhchau Dang,

 

thank you for replying 

i am using Liferay 7.0 version 

where is control Panel inside set the values articleViewPermissionsCheckEnabled

 

can you please guide me

 

Thank....

 

 

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Ramalingaiah. D:

where is control Panel inside set the values articleViewPermissionsCheckEnabled

  1. Navigate to Control Panel > Configuration > System Settings
  2. Under Web Experience, choose Web Content
  3. Look for the settings "Article view permissions check enabled"

Since it's marked as "default settings for all instances" rather than system-wide (which you can read about more in the System Settings part of the documentation), it's possible that changing it through the UI won't actually do anything for existing portal instances, and you'll need use files in order to replace the values for existing portal instances. However, it's also possible that it will just work.