Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
EZP-30344: Allowed limiting Content management to specific translations #2585
Squashed into one PR due to time constraints.
Many Limitations throw exception when dealing with unknown objects or targets, which makes it impossible to set some specific mixes of Limitations on a given policy. This had hit us in the past and now makes current changes impossible to implement.
To solve this issue we're introducing two new interfaces:
We've created the first class which objects follows the described behavior:
and a builder for DX and readability
Consider the following
$this->repository->getPermissionResolver()->canUser( 'content', 'edit', $content, [ (new Target\Builder\VersionBuilder()) ->updateFieldsTo( $contentUpdateStruct->initialLanguageCode, $contentUpdateStruct->fields ) ->build(), ] )
it checks if a user is able to edit the Content if new Version would contain new initial language and given fields (actually used only to extract language codes of modified translation).
We could try handling
To provide BC for existing Limitations other than