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

NullPointerException while viewing role permissions after upgrade

Details

    • 4
    • Database Upgrade

    Description

      Description
      While attempting viewing the permissions assigned to a role after upgrading, the UI breaks and a NullPointerException is thrown in the logs.

      Steps to Reproduce

      1. Start up a clean instance of Portal 6.2 SP20 
      2. Create a new Regular Role called 'Workflow Provider' and assign the permissions demonstrated in the screenshot, 62_Role_Permission.png.
      3. Shutdown Liferay
      4. Upgrade to master or use the dump provided lps-127032.sql
      5. Navigate to Roles and view the permissions set for the Workflow Provider role

      Expected Behavior: I can view the permissions assigned to this role
      Actual Behavior: The UI breaks and an error is thrown in the logs.

      2021-01-28 18:54:54.950 ERROR [http-nio-8080-exec-6][IncludeTag:128] Current URL /group/control_panel/manage?p_p_id=com_liferay_roles_admin_web_portlet_RolesAdminPortlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_mvcPath=%2Fedit_role_permissions.jsp&_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_tabs1=define-permissions&_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_redirect=&_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_backURL=http%3A%2F%2Flocalhost%3A8080%2Fgroup%2Fcontrol_panel%2Fmanage%3Fp_p_id%3Dcom_liferay_roles_admin_web_portlet_RolesAdminPortlet%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_mvcPath%3D%252Fview.jsp%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_roleType%3D1%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_displayStyle%3Ddescriptive%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_orderByCol%3Dtitle%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_orderByType%3Dasc%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_cur%3D1%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_delta%3D20%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_description%3D%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_name%3D%26_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_type%3D1%26p_p_auth%3Dtrx8y4bZ&_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_cmd=view&_com_liferay_roles_admin_web_portlet_RolesAdminPortlet_roleId=20536&p_p_auth=trx8y4bZ generates exception: java.lang.NullPointerException
      java.lang.NullPointerException
      	at java.util.ArrayList.<init>(ArrayList.java:178)
      	at com.liferay.portal.security.permission.ResourceActionsImpl.getModelPortletResources(ResourceActionsImpl.java:204)
      	at com.liferay.portal.kernel.security.permission.ResourceActionsUtil.getModelPortletResources(ResourceActionsUtil.java:88)
      	at org.apache.jsp.edit_005frole_005fpermissions_005fsummary_jsp._jspService(edit_005frole_005fpermissions_005fsummary_jsp:473)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
      	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
      	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:368)
      	at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:380)
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
      	at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
      	at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
      	at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:190)
      	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
      	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
      

      I believe this may be a regression from LPS-112055 as we changed the logic to simplify permission checking, however this change may not have taken into account permissions from models that no longer exist.

      Testing

      Master
      Reproduced in cdbf4321e72c9b8daf6d173de4e47a882c9a3990

      Attachments

        Issue Links

          Activity

            People

              support-lep@liferay.com SE Support
              samuel.ziemer Sam Ziemer
              Felipe Lins Felipe Lins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                1 year, 43 weeks, 1 day ago

                Packages

                  Version Package