{"record":{"id":"e26ee9fb9c4e940b","repo":"nextcloud/server","slug":"no-permissions-to-copy-object","errorCode":null,"errorMessage":"No permissions to copy object.","messagePattern":"No permissions to copy object\\.","errorType":"exception","errorClass":"Sabre\\DAV\\Exception\\Forbidden","httpStatus":403,"severity":"error","filePath":"apps/dav/lib/Connector/Sabre/ObjectTree.php","lineNumber":169,"sourceCode":"\t * @throws \\Sabre\\DAV\\Exception\\Locked\n\t * @throws \\Sabre\\DAV\\Exception\\NotFound\n\t * @throws \\Sabre\\DAV\\Exception\\ServiceUnavailable\n\t * @return void\n\t */\n\t#[\\Override]\n\tpublic function copy($sourcePath, $destinationPath) {\n\t\tif (!$this->fileView) {\n\t\t\tthrow new \\Sabre\\DAV\\Exception\\ServiceUnavailable('filesystem not setup');\n\t\t}\n\n\t\t$info = $this->fileView->getFileInfo(dirname($destinationPath));\n\t\tif ($this->fileView->file_exists($destinationPath)) {\n\t\t\t$destinationPermission = $info && $info->isUpdateable();\n\t\t} else {\n\t\t\t$destinationPermission = $info && $info->isCreatable();\n\t\t}\n\t\tif (!$destinationPermission) {\n\t\t\tthrow new Forbidden('No permissions to copy object.');\n\t\t}\n\n\t\t// this will trigger existence check\n\t\t$this->getNodeForPath($sourcePath);\n\n\t\t[$destinationDir, $destinationName] = \\Sabre\\Uri\\split($destinationPath);\n\t\ttry {\n\t\t\t$this->fileView->verifyPath($destinationDir, $destinationName);\n\t\t} catch (InvalidPathException $ex) {\n\t\t\tthrow new InvalidPath($ex->getMessage());\n\t\t}\n\n\t\ttry {\n\t\t\t$this->fileView->copy($sourcePath, $destinationPath);\n\t\t} catch (StorageNotAvailableException $e) {\n\t\t\tthrow new \\Sabre\\DAV\\Exception\\ServiceUnavailable($e->getMessage());\n\t\t} catch (ForbiddenException $ex) {\n\t\t\tthrow new Forbidden($ex->getMessage(), $ex->getRetry());","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Connector/Sabre/ObjectTree.php#L151-L187","documentation":"Error \"No permissions to copy object.\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/dav/lib/Connector/Sabre/ObjectTree.php:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}