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:
* 'Subtree' => array(
* 'Foo' => array( 'Bar' ),
* 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.
Legacy storage engine doesn't take this case into account.
*Note*: This occurs using RoleService::updatePolicy() and RoleService::updatePolicyByRoleDraft().