private function isMatchingExtension($oldName, $newName)
{
$user = $this->getUser();
if ($this->users()->hasRole($user['id'], 'root')) {
return true;
}
$oldFile = new \SplFileInfo($oldName);
$newFile = new \SplFileInfo($newName);
return $oldFile->getExtension() === $newFile->getExtension();
}