-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-6592: Allowed Location
to be a part of permission check for Object State assignment
#2112
Conversation
…ect State assignment
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@@ -821,7 +821,7 @@ ezplatform.object_state.state.bulk_delete: | |||
_controller: 'EzSystems\EzPlatformAdminUiBundle\Controller\ObjectStateController::bulkDeleteAction' | |||
|
|||
ezplatform.object_state.contentstate.update: | |||
path: /state/contentstate/update/{contentInfoId}/group/{objectStateGroupId} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a bc break, I guess we should create new route and deprecate that one.
); | ||
}), | ||
'choice_loader' => new CallbackChoiceLoader( | ||
function () use ($objectStateGroup, $location) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function () use ($objectStateGroup, $location) { | |
function () use ($objectStateGroup, $location): array { |
function () use ($objectStateGroup, $location) { | ||
return array_filter( | ||
$this->objectStateService->loadObjectStates($objectStateGroup), | ||
function (ObjectState $objectState) use ($location) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function (ObjectState $objectState) use ($location) { | |
function (ObjectState $objectState) use ($location): bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct approach. We can't make our permission layer to behave differently if used from UI and used as API.
@Nattfarinn where exactly does it behave differently than what we have in the API? |
This additional argument is used only in This could/should be solved in https://github.com/ezsystems/ezplatform-kernel/blob/1.3/eZ/Publish/Core/Limitation/SubtreeLimitationType.php by handling special case (maybe check |
We put more thought into this change and we can't change the API to facilitate Locations only to be used as a part of Permission check. I think the proper solution is to remove |
Requires: ezsystems/ezplatform-kernel#391
Currently, Content Object State assignment is done utilizing
ContentInfo
, which in my opinion is wrong, as that leaves Subtree Limitation pretty much useless, and yet, this limitation is available for a choosing when we are dealing with thestate/assign
policy.Therefore,
ContentInfo
was replaced withLocation
everywhere where it touches Object States assignment.Checklist:
$ composer fix-cs
)