Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

EZP-29539: Deleting object will remove all subtree items even when user does not have permission to delete them #2536

Merged
merged 3 commits into from
Feb 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
removes syntax unsupported in php5
  • Loading branch information
pawbuj committed Feb 27, 2019
commit 930e843dac773e3e4bb9885d36a789ba507929bd
Original file line number Diff line number Diff line change
@@ -264,7 +264,9 @@ public function testTrashRequiresPremissionsToRemoveAllSubitems()
);
$parentLocation = $locationService->loadLocations($parentContent->contentInfo)[0];
$childContent = $this->createFolder(['eng-US' => 'Child Folder'], $parentLocation->id);
$this->setExpectedException(UnauthorizedException::class);

$this->refreshSearch($repository);
$this->setExpectedException(\eZ\Publish\Core\Base\Exceptions\UnauthorizedException::class);
$trashService->trash($parentLocation);
}
}
2 changes: 1 addition & 1 deletion eZ/Publish/Core/Repository/TrashService.php
Original file line number Diff line number Diff line change
@@ -383,7 +383,7 @@ protected function getDateTime($timestamp)
* @throws \eZ\Publish\API\Repository\Exceptions\BadStateException
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
*/
private function userHasPermissionsToRemove(ContentInfo $contentInfo, Location $location): bool
private function userHasPermissionsToRemove(ContentInfo $contentInfo, Location $location)
{
if (!$this->repository->canUser('content', 'remove', $contentInfo, [$location])) {
return false;