Code Duplication    Length = 7-10 lines in 2 locations

eZ/Publish/Core/Repository/ContentService.php 2 locations

@@ 1517-1523 (lines=7) @@
1514
            );
1515
        }
1516
1517
        if (!$this->repository->canUser('content', 'versionremove', $versionInfo)) {
1518
            throw new UnauthorizedException(
1519
                'content',
1520
                'versionremove',
1521
                array('contentId' => $versionInfo->contentInfo->id, 'versionNo' => $versionInfo->versionNo)
1522
            );
1523
        }
1524
1525
        $versionList = $this->persistenceHandler->contentHandler()->listVersions(
1526
            $versionInfo->contentInfo->id,
@@ 1598-1607 (lines=10) @@
1595
        $destinationLocation = $this->repository->getLocationService()->loadLocation(
1596
            $destinationLocationCreateStruct->parentLocationId
1597
        );
1598
        if (!$this->repository->canUser('content', 'create', $contentInfo, [$destinationLocation])) {
1599
            throw new UnauthorizedException(
1600
                'content',
1601
                'create',
1602
                [
1603
                    'parentLocationId' => $destinationLocationCreateStruct->parentLocationId,
1604
                    'sectionId' => $contentInfo->sectionId,
1605
                ]
1606
            );
1607
        }
1608
1609
        $defaultObjectStates = $this->getDefaultObjectStates();
1610