Enterprise Liferay Concerns: Tips For Being Less Social

As a platform for portals, Liferay is inherently open to social activity. By default users have the ability to comment on pages, post on forums, have public profiles and connect to social networks. This blog will explore tips for ‘locking down’ Liferay for more limited social activity, which may be an important consideration for building business sites on Liferay.

Consider using Liferay to build a customer self-service site for commercial use, such as for a utility, city water department, cable company, etc. In this context, users should be able to maintain their accounts, see usage, make payments, etc. in a private manner. They have no reason to be aware of each other, nor need to interact with each other. Privacy of each user’s information is paramount in such applications.

Liferay User Isolation Tips

  • Disable profiles, meaning users can be created without profiles. By default users have profiles created. To change this, create a User Group, and in ControlPanel->User Groups->(Groupname) set ‘Public Pages’ to ‘None’ and ‘Private Pages’ to ‘None’. Thus, any users created in Liferay who are added to this user group have no profiles.
  • Restrict comment posting on pages with comments or message boards to registered users. In Control Panel->Message Boards->Permissions, uncheck any ‘Guest’ settings except ‘View’.
  • Hide user pictures and profile links from message board posts. By default, a picture placeholder and link to the user profile is created when a user posts a comment. This can be suppressed with a hook. Override the file (ROOT)/html/taglib/ui/discussion/page.jsp and change:
               userId="<%= message.getUserId() %>"
               userName="<%= HtmlUtil.escape(message.getUserName()) %>"
               displayStyle="<%= 2 %>"


               userId="<%= user.getUserId() %>"
               userName="<%= HtmlUtil.escape(PortalUtil.getUserName(user.getUserId(), StringPool.BLANK)) %>"
               displayStyle="<%= 2 %>
  • Disable access to hidden profiles in Message board/comments — by default, clicking on a user name in a message board comment brings up the user’s profile. This can be disabled with portal-ext.properties settings. Add these settings to portal-ext.properties:
  • Limit access to user names in search results–by default, user names in the Liferay database are searchable. This can be disabled with a hook. To remove the user from the search criteria, override the file (ROOT)/html/portlet/search/init.jsp and change:
    sb.append("{className: 'com.liferay.portal.kernel.search.facet.AssetEntriesFacet', data: {frequencyThreshold: 1, values: ['com.liferay.portlet.bookmarks.model.BookmarksEntry','com.liferay.portlet.blogs.model.BlogsEntry','com.liferay.portlet.calendar.model.CalEvent','com.liferay.portlet.documentlibrary.model.DLFileEntry','com.liferay.portlet.journal.model.JournalArticle','com.liferay.portlet.messageboards.model.MBMessage','com.liferay.portlet.wiki.model.WikiPage','com.liferay.portal.model.User']}, displayStyle: 'asset_entries',fieldName: 'entryClassName', label: 'asset-type', order: 'OrderHitsDesc', static: false, weight: 1.5},");


    sb.append("{className: 'com.liferay.portal.kernel.search.facet.AssetEntriesFacet', data: {frequencyThreshold: 1,values: ['com.liferay.portlet.bookmarks.model.BookmarksEntry','com.liferay.portlet.blogs.model.BlogsEntry','com.liferay.portlet.calendar.model.CalEvent','com.liferay.portlet.documentlibrary.model.DLFileEntry','com.liferay.portlet.journal.model.JournalArticle','com.liferay.portlet.messageboards.model.MBMessage','com.liferay.portlet.wiki.model.WikiPage']}, displayStyle: 'asset_entries',fieldName: 'entryClassName', label: 'asset-type', order: 'OrderHitsDesc', static: false, weight: 1.5},");
  • Consider using a third-party workflow engine such as Kaleo Workflow to add moderation to commenting and message boards.

With a few simple changes, user visibility and awareness of other users can be locked down in Liferay.

Tagged with: , — Posted in Software Development

2 comments on “Enterprise Liferay Concerns: Tips For Being Less Social

  1. I would like to known about your comments application. I need to build a similar solution. Thanks

    • Hello, the tips in this blog article are referring to customizations to the standard Liferay commenting and blogging sub-systems. We didn’t have a 3rd party comments application.

Comments are closed.