Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-73170

LayoutFinder.findByNoPermissions returns too many results

    Details

      Description

      Currently we run the following query in order to find out what layouts are missing permissions.

      SELECT
      	{Layout.*}
      FROM
      	Layout
      LEFT JOIN
      	ResourcePermission ON
      		(ResourcePermission.companyId = Layout.companyId) AND
      		(ResourcePermission.name = ?) AND
      		(ResourcePermission.scope = ?) AND
      		(ResourcePermission.primKeyId = Layout.plid) AND
      		(ResourcePermission.roleId = ?)
      WHERE
      	ResourcePermission.primKeyId IS NULL
      

      However, the roleId we use is specific to a companyId, and so any Layout in a portal instance that is different from the one we are checking will return from this query.

      As a result, even if a layout has permissions for the specified role, they will still come back from this query. However, since they won't actually need any updates, this results in potentially hundreds of thousands of fetches that result in no work being accomplished.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 15 weeks ago

                Packages

                Version Package
                7.0.0 DXP FP22
                7.0.0 DXP SP4
                7.0.4 CE GA5