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

RoleLocalServiceUtil.getResourceRoles(long, String, int, String) always throws a NullPointerException due to missing SQL query

    Details

      Description

      Description
      The RoleLocalServiceUtil.getResourceRoles(long, String, int, String) method is completely unusable because its SQL query is missing from portal.xml. Calling this method will always result in a NullPointerException being thrown.

      Steps to Reproduce

      1. Start up Liferay
      2. Log in as an administrator.
      3. Navigate to Admin > Control Panel > Server Administration > Scripts
      4. Change Language to Groovy.
      5. Paste the contents of the attached callGetResourceRoles.groovy file into the Script box (use the file that corresponds to the version of Liferay you are testing on).
      6. Click execute.

      Expected Result: The script will complete without error. For this script, this will most likely just return an empty map as follows:

      [:]
      

      If you want to test it in more detail, you can modify the name, scope, and primKey variables to match an entry in the ResourcePermission table and see the map that is returned.
      Actual Result: The script throws a NullPointerException, which you can see in the console. The map of resource roles is not printed out.

      Reproduced in:
      master - a61624d5129b8d26f7ba6a9c07f76130fd565b28: Reproduced
      ee-7.0.x - 606d9d902aef50ca425f401e51ef30ff8d02e70e - Reproduced
      ee-6.2.x - da614c15129e7e4f4fc1721372f3621f44adb365: Reproduced

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 23 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP13
                  7.0.0 DXP SP3
                  7.0.3 CE GA4
                  7.0.X EE
                  7.1.X
                  Master