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

Website Toolbar cache doesn't work properly when Owner( Self ) Policy Limitation is used

    XMLWordPrintable

Details

    Description

      Currently, the cache related to Website Toolbar doesn't take into the account if someone is an owner of the viewed Content Object. This means that if someone who doesn't have content/edit permissions access views this Content Object first, then onwer won't have an option to edit that Content Object using Website Toolbar.
      This issue happens only in prod environment.

      Steps to reproduce

      1. Create new eZ Publish installation.
      2. Login to the Legacy Backend as admin.
      3. Navigate to "User accounts">"Roles and policies">"Editor". Change the "content/edit/No limitations" policy for this role to "content/edit/Owner(Self)". Save the role.
      4. In the "Editors" User Group create two users: user1 and user2.
      5. In the front-office, login as user1.
      6. Using the Website Toolbar, create new Content Object (for example Folder), but don't navigate to it yet.
      7. Logout as user1 and login as user2.
      8. Navigate to the created Content Object. In the Website Toolbar, there will be no pencil icon (this behaviour is correct, since user2 is not an owner of this Content Object).
      9. Logout as user2 and login as user1.
      10. Navigate to the created Content Object. In the Website Toolbar, there will be no pencil icon (this behaviour is incorrect, since user1 is an owner of this Content Object).

      If you skip steps 7-9, then the pencil icon will show properly for user1 when he is the first to view that Content Object.

      Further problems reported by the customer after applying first solutions:
      1) There is exception in the application logs on every request:

      request.CRITICAL: Uncaught PHP Exception RuntimeException: "Controller "eZ\Bundle\EzPublishLegacyBundle\Controller\WebsiteToolbarController::websiteToolbarAction()" requires that you provide a value for the "$locationId" argument (because there is no default value or because there is a non optional argument after this one)." at [...path deleted...]\ezpublish\cache\prod\classes.php line 2233 {"exception":"[object] (RuntimeException(code: 0): Controller \"eZ\\Bundle\\EzPublishLegacyBundle\\Controller\\WebsiteToolbarController::websiteToolbarAction()\" requires that you provide a value for the \"$locationId\" argument (because there is no default value or because there is a non optional argument after this one). at [...path deleted...]\\ezpublish\\cache\\prod\\classes.php:2233)"} []
      

      2) URL values in the Websitetoolbar form are invalid (/_fragment instead of valid content URI):

      <!-- START: including template: design/standard/templates/content/edit_redirection.tpl (design:content/edit_redirection.tpl) -->
      <input type="hidden" name="RedirectURIAfterPublish" value="/_fragment">
      <input type="hidden" name="RedirectIfDiscarded" value="/_fragment">
      <!-- STOP: including template: design/standard/templates/content/edit_redirection.tpl (design:content/edit_redirection.tpl) -->
      

      These issues need to be solved as a follow-up.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jacek.foremski-obsolete@ez.no Jacek Foremski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: