Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-25636

User can't access trash if 1+ items are not readable

    XMLWordPrintable

Details

    Description

      Editor is not able to read content moved to trash due to lack of permissions.

      It's because Editors permissions are limited to /1/2 and /1/42 locations (home and media), but moving content to trash unpins content from location tree.

      Symptoms:

      • User gets 401 error on "Move to trash" action (content is moved to trash, but user lost permission to read it for purpose of notification and/or redirection)
      • User is not able to view Trash page (unless trash is empty)

      This can be solved by assigning the Editor role with no subtree limitation (with corresponding changes to policies, as needed to avoid giving editors excessive permissions).

      However, it is still a problem that users are not allowed to see the trash at all if it contains one or more items the user is not allowed to see. Expected: Trash should be accessible, and the items the user is allowed to read should be visible, others not.

      The problem seems to be that Trash/Handler::findTrashItems() has no way of limiting results based on user permissions, so it returns everything, causing trouble down the line where things are assumed to be readable. To compare, SearchService::findLocations(), which is used for content in the tree, has a $filterOnUserPermissions parameter. But this is not implemented in the trash stack.

      Steps to reproduce:

      • Create a user, let's call it User McUserface. Assign the editor role to this user, with no limitation on assignment. Verify that the editor role has no access to content in the Restricted section.
      • Confirm that User McUserface can view and edit normal content, and view content in trash.
      • As admin, create some content, place it in the Restricted section, then send it to trash.
      • As User McUserface, try to view the trash again. It fails with an exception.

      Expected: User McUserface should be able to view the trash. The content in the restricted section should not be visible.

      Attachments

        Activity

          People

            Unassigned Unassigned
            slawomir.uchto@ibexa.co Sławomir Dołżycki-Uchto
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 3 hours, 55 minutes
                1w 3h 55m