Search code examples
liferay-6liferay-aui

Display pages tree


I have problem with showing tree of display pages in display pages section of web content creation form. I created some pages with asset publishers on them. I set these publishers to be the default asset publishers for these pages. I created these pages and asset publishers under role admin. When I open display pages section in creation form of any web content it shows me site map where can I see pages on which is asset publisher, see image:

enter image description here

You can see that black color is for pages with asset publishers.

But when I login with another user I cannot expand this tree. The only thing I can see is "1st level" of this site map:

enter image description here

I tried to add all possible rights to this user, all possible rights to any resources but without assigning role "administrator" for this user I cannot browse this tree.

When I click on little "plus icon" in this tree I can see that it is making request on "/c/layouts_admin/get_layouts" but in request I can see only html which is telling me that I haven't sufficient roles to obtain right content.

I made some investigation. I tried to make request under this user from jsonws api ("/api/jsonws?signature=%2Flayout%2Fget-layouts-6-groupId-privateLayout-parentLayoutId-incomplete-start-end"). I tried the same method with same parameters as they were in request from site map tree and it returned me right content.

So from "Choose Display Page" window it tells me that I haven't good role but when I call api from jsonws with same parameters it returns me good result. Where can be problem?

Thanks, Patrik


Solution

    1. Hi dear Add this Snippet in com.liferay.portal.struts.PortalRequestProcessor.java
    2. processRoles(HttpServletRequest, HttpServletResponse, ActionMapping)
    3. After user O bject is Created.

      if(user!=null){ if(path.equals("/layouts_admin/get_layouts")){ return true; } }