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

RoleContributor addRoleId not taken into account for collections

Details

    Description

      I've created a sample RoleContributor:

      https://gist.github.com/fabian-bouche-liferay/7bbc95bf9f6c14ba497ac090d34ed793

      The idea behind that RoleContributor was to dynamically add or remove a roleId based on the context.

      Reproduction steps:

      1/ Create a Role with the Key "IP"

      2/ Deploy a module with that component

      3/ Create a site with both a public and a private content page

      4/ Upload two documents to that site: the first one should be viewable with the "IP" Role while the second should be viewable with the built-in "Guest" Role.

      5/ Create a dynamic collection that selects all the documents of the site.

      6/ Create a manual collection of documents and pick the two documents.

      7/ On the site's public page, put:

          a/ A Collection display with the dynamic collection

          b/ A Collection display with the manual collection

          c/ An asset publisher with the dynamic collection

          d/ An asset publisher with the manual collection

          e/ A media gallery widget

      Expected results:

      The 5 widgets on the page display the 2 documents.

      Actual results:

      b, d and e display both documents.

      But a and c do not display the IP role restricted document.

       

      Attachments

        Activity

          People

            eric.park Eric Park
            fabian.bouche Fabian Bouché
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 7 weeks ago
              Development End Date:

              Packages

                Version Package
                7.3.X
                7.4.3.11 CE GA11
                Master