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

code change in VerifyResourcePermissions class under protected void doVerify() method done in SP 10 missing an actual runable object



      protected void doVerify() throws Exception {
      long[] companyIds = PortalInstances.getCompanyIdsBySQL();

      for (long companyId : companyIds) {
      Role role = RoleLocalServiceUtil.getRole(
      companyId, RoleConstants.OWNER);

      List<VerifyResourcedModelRunnable> verifyResourcedModelRunnables =
      new ArrayList<VerifyResourcedModelRunnable>(_MODELS.length);

      for (String[] model : _MODELS)

      { VerifyResourcedModelRunnable verifyResourcedModelRunnable = new VerifyResourcedModelRunnable( role, model[0], model[1], model[2]); verifyResourcedModelRunnables.add(verifyResourcedModelRunnable); }

      Before the change of this code, when the verify process is invoked, in the console log it would print out logs as follow:
      2015-03-17 10:27:58,202 [INFO ] [localhost-startStop-1] [com.liferay.portal.verify.VerifyProcess:?] Verifying com.liferay.portal.verify.VerifyResourcePermissions
      2015-03-17 10:27:58,418 [INFO ] [localhost-startStop-1] [com.liferay.portal.verify.VerifyResourcePermissions:?] Processed 100 resource permissions for com.liferay.portlet.announcements.model.AnnouncementsEntry
      However, after the code change, when VerifyResourcePermission is invoked it print out logs as below:
      2015-03-16 13:14:22,174 [INFO ] [localhost-startStop-1] [com.liferay.portal.verify.VerifyProcess:?] Verifying com.liferay.portal.verify.VerifyResourcePermissions
      2015-03-16 13:14:22,360 [INFO ] [localhost-startStop-1] [com.liferay.portal.verify.VerifyResourcePermissions:?] Processed 100 resource permissions for com.liferay.portal.model.Layout
      Customer's understanding of such code change caused below situation:
      Taking a look at the code, you have a situation where the for loop is just adding the VerifyResourcedModelRunnable to the List, but never actually calling the run method. So the individual validations for model defined in the _MODELS array are never validated. Instead the code only executes the verifyLayout(role). The for loop should include execution of the Runnable objects to do the verification.
      This happens in SP 10 code, but in branch and trunk the missing code was added back. Please help create a fix to address this


          Issue Links



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


                • Created:
                  Days since last comment:
                  5 years, 15 weeks, 1 day ago


                  Version Package
                  6.2.3 CE GA4
                  6.2.X EE
                  7.0.0 M5