/** * Transition a record's owner if permitted. * * @param Content $entity * @param integer $ownerId */ protected function transistionRecordOwner(Content $entity, $ownerId) { $recordId = $entity->getId(); $contentTypeName = (string) $entity->getContenttype(); $canChangeOwner = $this->users->isAllowed("contenttype:{$contentTypeName}:change-ownership:{$recordId}"); if (!$canChangeOwner) { $this->loggerFlash->error(Trans::__('general.access-denied.content-not-modified', ['%title%' => $entity->getTitle()])); return; } $entity->setOwnerid($ownerId); $entity->_modified = true; }