{"record":{"id":"9a4b3c5c179543a7","repo":"nextcloud/server","slug":"permission-denied-to-rename-this-collection","errorCode":null,"errorMessage":"Permission denied to rename this collection","messagePattern":"Permission denied to rename this collection","errorType":"exception","errorClass":"Sabre\\DAV\\Exception\\Forbidden","httpStatus":403,"severity":"warning","filePath":"apps/dav/lib/Comments/RootCollection.php","lineNumber":167,"sourceCode":"\t *\n\t * This is used to generate the url.\n\t *\n\t * @return string\n\t */\n\t#[\\Override]\n\tpublic function getName() {\n\t\treturn $this->name;\n\t}\n\n\t/**\n\t * Renames the node\n\t *\n\t * @param string $name The new name\n\t * @throws Forbidden\n\t */\n\t#[\\Override]\n\tpublic function setName($name) {\n\t\tthrow new Forbidden('Permission denied to rename this collection');\n\t}\n\n\t/**\n\t * Returns the last modification time, as a unix timestamp\n\t *\n\t * @return ?int\n\t */\n\t#[\\Override]\n\tpublic function getLastModified() {\n\t\treturn null;\n\t}\n}\n","sourceCodeStart":149,"sourceCodeEnd":180,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Comments/RootCollection.php#L149-L180","documentation":"RootCollection::setName() refuses renaming of the comments root with Forbidden (HTTP 403). Sabre maps MOVE-with-destination on a collection to setName, so any attempt to relocate the comments root or its layout fails.","triggerScenarios":"MOVE /remote.php/dav/comments with a Destination header attempting to rename or relocate the collection; drag-and-drop reorganization in WebDAV-mounted drives.","commonSituations":"Sync clients attempting tree reorganization; users mounting the DAV root and moving folders; scripts assuming WebDAV rename works uniformly across all collections.","solutions":["Do not issue MOVE against collection nodes under /dav/comments.","If a different URL is needed, fix the client configuration that builds the URL.","Restrict drag-and-drop operations when the comments tree is mounted."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never MOVE or rename anything under /dav/comments.","Fix wrong URLs in client configuration instead of relocating collections.","Restrict drag-and-drop when the DAV tree is mounted as a drive."],"tags":["dav","comments","move","forbidden"],"backgroundTag":"permission-denied","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}