Message-ID: <409996998.2946.1485851362260.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2945_1560624471.1485851362260" ------=_Part_2945_1560624471.1485851362260 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html OwnerLimitation

OwnerLimitation

A Limitation to specify that only the owner of the Content item = gets a certain access right.

Id= entifier Owner
Va= lue Class eZ\Publish\API\Repository\Values\User\Limi= tation\OwnerLimitation
Type Class eZ\Publish\Core\Limitation\O= wnerLimitationType
Criterion used eZ\Publish\API\Repository\Va= lues\Content\Query\Criterion\UserMetadata( UserMetadata::OWNER )
Role Limitation no
Possible values
Value UI value Description
1 "self"

Only the User who is the owner gets access

2 "session"

Same as "self"

Legacy compatibil= ity notes:
  1. "session" is deprecated and works exactly like "self" in Public API sin= ce it has no knowledge of user Sessions
  2. A User is no longer automatically assumed to be the owner of themselves= and gets access to edit themselves when the Owner limitation is used in Pu= blic API

Workaround for the OwnerLimitation on Users

To make sure the User gets access to themselves when using OwnerLimitati= on across 4.x and 5.x, the solution is to change the User to be the owner o= f their own Content item.

This is accomplished using a privileged user to do the following API cal= ls:

=20
$user =3D $userService->loadUser( $userId );
$contentMetadataUpdateStruct =3D $contentService->newContentMetadataUpda=
teStruct();
$contentMetadataUpdateStruct->ownerId =3D $user->id;
$contentService->updateContentMetadata( $user->getVersionInfo()->g=
etContentInfo(), $contentMetadataUpdateStruct );
=20
------=_Part_2945_1560624471.1485851362260--