nextcloud/server · error · Sabre\DAV\Exception\Forbidden

No permissions to copy object.

Error message

No permissions to copy object.

What it means

Error "No permissions to copy object." thrown in nextcloud/server.

Source

Thrown at apps/dav/lib/Connector/Sabre/ObjectTree.php:169

	 * @throws \Sabre\DAV\Exception\Locked
	 * @throws \Sabre\DAV\Exception\NotFound
	 * @throws \Sabre\DAV\Exception\ServiceUnavailable
	 * @return void
	 */
	#[\Override]
	public function copy($sourcePath, $destinationPath) {
		if (!$this->fileView) {
			throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
		}

		$info = $this->fileView->getFileInfo(dirname($destinationPath));
		if ($this->fileView->file_exists($destinationPath)) {
			$destinationPermission = $info && $info->isUpdateable();
		} else {
			$destinationPermission = $info && $info->isCreatable();
		}
		if (!$destinationPermission) {
			throw new Forbidden('No permissions to copy object.');
		}

		// this will trigger existence check
		$this->getNodeForPath($sourcePath);

		[$destinationDir, $destinationName] = \Sabre\Uri\split($destinationPath);
		try {
			$this->fileView->verifyPath($destinationDir, $destinationName);
		} catch (InvalidPathException $ex) {
			throw new InvalidPath($ex->getMessage());
		}

		try {
			$this->fileView->copy($sourcePath, $destinationPath);
		} catch (StorageNotAvailableException $e) {
			throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage());
		} catch (ForbiddenException $ex) {
			throw new Forbidden($ex->getMessage(), $ex->getRetry());

View on GitHub (pinned to ecdeb153ff)

When it happens

Trigger: Thrown at apps/dav/lib/Connector/Sabre/ObjectTree.php:169 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nextcloud/server@ecdeb153ff (2026-08-17). Data as JSON: /api/errors/e26ee9fb9c4e940b. Report an issue: GitHub.