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

Content/edit policy with Language Limitation should allow to edit translated content

    Details

      Description

      Currently, Language Limitation on content/edit policy allows the user only to edit the content if that content has the main language equal to the one in Language Limitation. So, if a content has two languages (eng-GB, pol-PL) and eng-GB is the main one for this content and a user has a content/edit policy with Language Limitation on pol-PL, then the user is not allowed to edit this content (even pol-PL translation).

      Steps to reproduce

      1. Create new eZ Platform installation.
      2. Add another language (for example pol-PL) in the Platform UI and in ezplatform.yml file.
      3. Translate the main "eZ Platform" Folder Content Object to another language.
      4. Create a new group of users and a new user in that group.
      5. Create a new role. Add the following policies to the role:
        • user/login/no limitations
        • content/read/no limitations
        • content/edit/Language( pol-PL )
        • content/publish/Language( pol-PL )
      6. Assign this new role to the created group of users.
      7. Logout. Login as a created user.
      8. Edit the "eZ Platform" Folder Content Object in pol-PL. When trying to save the draft, you will have the following error in your browser's console:

        {
            "ErrorMessage": {
                "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
                "errorCode": 401,
                "errorMessage": "Unauthorized",
                "errorDescription": "User does not have access to 'edit' 'content' with: contentId '1''",
                "trace": "#0 C:\\Apache24\\htdocs\\ezplatform\\app\\cache\\dev\\appDevDebugProjectContainer.php(38458): eZ\\Publish\\Core\\Repository\\ContentService->createContentDraft(Object(eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo), NULL, Object(eZ\\Publish\\Core\\Repository\\Values\\User\\UserReference))\n#1 C:\\Apache24\\htdocs\\ezplatform\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\SignalSlot\\ContentService.php(320): eZPublishCoreRepositoryContentService_0000000053603e1e0000000070f08ee386b4e9c06d7d9d156c88b8c3cd5f614d->createContentDraft(Object(eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo), NULL, NULL)\n#2 C:\\Apache24\\htdocs\\ezplatform\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\REST\\Server\\Controller\\Content.php(413): eZ\\Publish\\Core\\SignalSlot\\ContentService->createContentDraft(Object(eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo))\n#3 C:\\Apache24\\htdocs\\ezplatform\\vendor\\ezsystems\\platform-ui-bundle\\Controller\\Rest\\ContentController.php(61): eZ\\Publish\\Core\\REST\\Server\\Controller\\Content->createDraftFromCurrentVersion('1')\n#4 [internal function]: EzSystems\\PlatformUIBundle\\Controller\\Rest\\ContentController->createDraftFromCurrentVersion('1')\n#5 C:\\Apache24\\htdocs\\ezplatform\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(144): call_user_func_array(Array, Array)\n#6 C:\\Apache24\\htdocs\\ezplatform\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\HttpKernel.php(64): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#7 C:\\Apache24\\htdocs\\ezplatform\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel.php(69): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#8 C:\\Apache24\\htdocs\\ezplatform\\vendor\\symfony\\symfony\\src\\Symfony\\Component\\HttpKernel\\Kernel.php(185): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#9 C:\\Apache24\\htdocs\\ezplatform\\web\\app.php(70): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#10 {main}",
                "file": "C:\\Apache24\\htdocs\\ezplatform\\vendor\\ezsystems\\ezpublish-kernel\\eZ\\Publish\\Core\\Repository\\ContentService.php",
                "line": 1044
            }
        }
        

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jacek Foremski (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: