Issue
- After upgrading to Liferay DXP 7.1+, guests users cannot see some web contents.
- This is also reproduced for users that aren't members of one site. They cannot see web contents that belong to that site.
Environment
- Liferay DXP 7.1+ upgraded from Liferay 7.0 or 6.x
Resolution
- The default setting of older Liferay versions (Portal 6.0, 6.1, 6.2 and DXP 7.0) has the web content view permissions check option not selected, so by default any guest user can view all web contents.
- Starting with Liferay 7.1, default behavior was changed to now have the view permissions check option selected to be consistent with web content search results and other Liferay functionalities (document library, blogs or wiki), where the view permissions check were selected by default, as well.
- After upgrading to Liferay DXP 7.1+, if you have users that cannot see some web contents, you have the following options to resolve the issue:
-
Option 1: Manually change specific web content or role permissions, granting view permissions as necessary
- From 2024.Q2, you can leverage Setting Web Content Articles Permissions in Bulk.
-
Option 2: Deselect Article view permissions check enabled setting (note: that setting was removed as of DXP 7.4 Update 26, for more information see LPS-153517):
- From UI: Open view permissions for all web content articles by going to System Settings > Web Experience > Web Content and deselect Article view permissions check enabled option.
- From config file: Create a file com.liferay.journal.configuration.JournalServiceConfiguration.config in your osgi/configs folders containing the information:
articleViewPermissionsCheckEnabled="false"
- Option 3: If the above proposed solutions are not feasible, you can execute the attached groovy script: ModifyJournalArticlePermissionsgroovyScript.txt.
-
Option 1: Manually change specific web content or role permissions, granting view permissions as necessary
NOTE: Be sure to take a backup of your database prior to making any changes. Always test the changes in a lower environment before making changes in production.
Making manual changes to the database is not recommended, and should be carefully assessed based on your own business needs and risk factors. Any such operation is performed at the sole discretion of your own team.
-
-
- The purpose of the script is to add view permissions to all web content articles such that any role that has permission to view a portlet that has been manually configured to display the web content article will also have permission to view the web content article itself.
- The script contains a configurable
dryRun
boolean variable on line 77. This is set totrue
by default, meaning that the script will not make any modifications to the articles' permissions, but will merely report what it would have done ifdryRun
were set tofalse
. If you change it tofalse
, modifications will be applied.
-
-
-
Option 4: In case web contents are not viewable to guest users because the web content folder view permission is disabled, you can either set view permission for Guest role in that folder, or set the following property to
false
in your portal-ext.properties file so parent folder is not checked (see Published web contents are not visible to users):
Set the following to true to automatically check the view permission on parent categories or folders when checking the permission on a specific item.
For example, if set to true, to be able to have access to a document, a user must have the view permission on the document's folder and all its parent folders.
Or, to have access to a comment, a user must have the view permission on the comments's category and all its parent categories.
Env: LIFERAY_PERMISSIONS_PERIOD_VIEW_PERIOD_DYNAMIC_PERIOD_INHERITANCE
Defaults:
permissions.view.dynamic.inheritance=true
-
Option 4: In case web contents are not viewable to guest users because the web content folder view permission is disabled, you can either set view permission for Guest role in that folder, or set the following property to
Additional Information
- Official Documentation:
- Roles and Permissions FAQ
- This behavior was changed in LPS-73847
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In