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

Impossible to update a policy with no limitations

    XMLWordPrintable

    Details

      Description

      Using public API, when updating a policy without limitations, following exception is thrown:

      Catchable Fatal Error: Argument 2 passed to eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway\ExceptionConversion::addPolicyLimitations() must be of the type array, string given, called in /Users/lolautruche/workspace/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/User/Handler.php on line 443
      

      This is because when there is no limitations, limitations property of SPI policy is *, as documented in \eZ\Publish\SPI\Persistence\User\Policy:

          /**
           * Array of policy limitations, which is just a random hash map.
           *
           * The limitation array may look like:
           * <code>
           *  array(
           *      'Subtree' => array(
           *          '/1/2/',
           *          '/1/4/',
           *      ),
           *      'Foo' => array( 'Bar' ),
           *      …
           *  )
           * </code>
           *
           * Where the keys are the limitation identifiers, and the respective values
           * are an array of limitation values
           *
           * @var array|string If string, then only the value '*' is allowed, meaning all limitations.
           *                   Can not be a empty array as '*' should be used in this case.
           */
          public $limitations;
      

      Legacy storage engine doesn't take this case into account.

      *Note*: This occurs using RoleService::updatePolicy() and RoleService::updatePolicyByRoleDraft().

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jerome.vieilledent-obsolete@ez.no Jérôme Vieilledent (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: