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

Dock Bar disappears in an edge case related to Organizational site and Activity Portlet

    Details

      Description

      Steps to reproduce:
      1. Login as Administrator.
      2. Create an user, let’s say “User A”.
      3. Create an Organization, let’s say “Org A”
      a. Assign “User A” to “Org A”.
      4. Create an Organizational site, let’s say “Org Site A”.
      a. Create a page in “Org Site A” called “ test”.
      b. Create a child page under “test” page, called “blog”.
      i. Add “Blogs” portlet to “Blog” page.
      1. Set the scope of the “Blogs” portlet to “blog” (current page)
      2. Create a Blog Entry, let’s say “Test Blog Entry”.
      5. Login as “User A”. Add a comment in “Test Blog Entry”.
      6. Go to “My Dashboard”.
      7. Add “Activities” portlet to “My Dashboard”.
      8. Click on the “Test Blog Entry” link from the “Activities” portlet.
      9. The dock bar is gone. An "No Layout exists" exception shows in log.

      Cause:
      1. There is a layout type called Virtual Layout. The concept of the Virtual Layout is:
      a. If a page/layout is belongs to a group of users, such as the page/layout of a User Group Site/Organizational site, the page/layout can exist in to forms: (Real) Layout and Virtual Layout.
      i. When a user is accessing the pages thru the User Group Site/Organizational site directly, Liferay will use the (Real) Layout. The URL of the page is: /web/

      {org}/{page}
      ii. When a user is accessing the pages thru the Dashboard, Liferay will wrap the (Real) Layout into a Virtual Layout. The URL of the page is: /web/{user-id}/~/{org}

      /

      {page}
      b. The reason of having Virtual Layout is because Liferay want to make the page to look like it belongs to the User Dashboard.

      2. When user click on the “Test Blog Entry” link from the “Activities” portlet in “My Dashboard”, the URL will go to /web/{user-id}/~/{org}/{page}

      , which is a Virtual Layout.

      3. In the Dock Bar code, In LIFERAY_HOME/tomcat-7.0.42/webapps/ROOT/html/portlet/dockbar/view_page_customization_bar.jspf
      a. At line 18, there is one call to LayoutPermissionUtil: LayoutPermissionUtil.containsWithoutViewableGroup(permissionChecker, layout, false, ActionKeys.CUSTOMIZE)

      4. In LayoutPermissionImpl
      a. At line 197 – 203, it convert the virtual layout to a (Real) Layout.
      b. At line 278, When calling layout.getGroupId(), the correct groupId is returned, because the layout is already converted to the (Real) Layout.

      5. So far, we don’t have any problem.

      6. In the Dock Bar code again, In LIFERAY_HOME/tomcat-7.0.42/webapps/ROOT/html/portlet/dockbar/view_page_customization_bar.jspf
      a. At line 19, there is one call to LayoutPermissionUtil: LayoutPermissionUtil.containsWithoutViewableGroup(permissionChecker, layout, false, ActionKeys.UPDATE). We have problem here.

      7. In LayoutPermissionImpl
      a. At line 278, When calling layout.getGroupId(), the WRONG groupId is returned, because the layout is a Virtual Layout.

      8. Additional Thoughts: However, the problem only happens when page belongs to a Organizational site. It does not happen when a page belongs User Group Site. What is the difference since they both are Virtual Layouts?
      a. It is because, Liferay did a trick for the pages belongs User Group Site: Liferay will treat the Virtual Page as it is belongs to the My Dashboard (User Personal Site). Which means, if the user has “Manage Page” permission of their personal site, he/she will have “Manage Page” permission on the Virtual Pages that belongs to the My Dashboard (User Personal Site).
      i. In LayoutPermissionImpl, at line 262 – 267, it will return true directly.
      b. However, Liferay did NOT apply the same trick to the pages belongs Organizational site.

        Attachments

          Activity

            People

            • Assignee:
              andy.auge Andy Auge (Inactive)
              Reporter:
              kzhang Kan Zhang
              Participants of an Issue:
              Recent user:
              Esther Sanz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 25 weeks, 1 day ago

                Packages

                Version Package
                6.2.X EE