{"record":{"id":"ef6fe12fd50f9c62","repo":"pentaho/pentaho-kettle","slug":"cannot-move-another-users-home-directory","errorCode":null,"errorMessage":"Cannot move another users home directory","messagePattern":"Cannot move another users home directory","errorType":"exception","errorClass":"RepositoryObjectAccessException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":623,"sourceCode":"    readWriteLock.writeLock().lock();\n    try {\n      RepositoryFile homeFolder;\n      RepositoryFile folder;\n\n      homeFolder = pur.getFile( ClientRepositoryPaths.getUserHomeFolderPath( user.getLogin() ) );\n      folder = pur.getFileById( dirId.getId() );\n\n      finalName = ( newName != null ? newName : folder.getName() );\n      interimFolderPath = getParentPath( folder.getPath() );\n      finalParentPath = ( newParent != null ? getPath( null, newParent, null ) : interimFolderPath );\n      // Make sure the user is not trying to move their own home directory\n      if ( isSameOrAncestorFolder( folder, homeFolder ) ) {\n        // Then throw an exception that the user cannot move their own home directory\n        throw new KettleException( \"You are not allowed to move/rename your home folder.\" );\n      }\n\n      if ( !renameHomeDirectories && isUserHomeDirectory( folder ) ) {\n        throw new RepositoryObjectAccessException( \"Cannot move another users home directory\",\n          RepositoryObjectAccessException.AccessExceptionType.USER_HOME_DIR );\n      }\n\n      pur.moveFile( dirId.getId(), finalParentPath + RepositoryFile.SEPARATOR + finalName, null );\n\n      rootRef.clearRef();\n      return dirId;\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to move/rename directory with id [\" + dirId + \"] to new parent [\"\n        + finalParentPath + \"] and new name [\" + finalName + \"]\", e );\n    } finally {\n      readWriteLock.writeLock().unlock();\n    }\n  }\n\n  protected RepositoryFileTree loadRepositoryFileTree( String path ) {\n    readWriteLock.readLock().lock();\n    RepositoryFileTree result;","sourceCodeStart":605,"sourceCodeEnd":641,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L605-L641","documentation":"PurRepository.renameRepositoryDirectory refuses to rename/move a repository directory that is another user's home directory. The PUR (Pentaho Enterprise Repository) adapter enforces server-side policy that home folders of other users are immutable to the caller. It throws RepositoryObjectAccessException with AccessExceptionType.USER_HOME_DIR to signal this policy violation.","triggerScenarios":"Calling renameRepositoryDirectory (or RepositoryDirectory rename flows that delegate to it) with a folder argument that isUserHomeDirectory(folder) identifies as some user's home folder, while renameHomeDirectories is false (i.e. the current user is not allowed to move home directories).","commonSituations":"Admin scripts that bulk-reorganize /home; renaming a parent folder that contains or equals another user's home; UI drag-and-drop of another user's home folder; migration scripts run with an account lacking home-move rights.","solutions":["Rename a directory other than another user's home folder, or rename/move only its children instead of the home folder itself.","Perform the operation as an administrator and enable the renameHomeDirectories option so home folders may be moved.","Catch RepositoryObjectAccessException and check AccessExceptionType.USER_HOME_DIR to skip home folders in bulk operations.","Verify the folder's path before renaming: if it lies under /home, exclude it."],"exampleFix":"// before\nrepository.renameRepositoryDirectory(dirId, newParentDir, newName);\n// after\nif (!isUnderHome(dir.getPath())) {\n  repository.renameRepositoryDirectory(dirId, newParentDir, newName);\n} else {\n  log.warn(\"Skipping home directory \" + dir.getPath());\n}","handlingStrategy":"try-catch","validationCode":"RepositoryDirectoryInterface home = repo.getUserHomeDirectory();\nString path = dir.getPath();\nif (path.startsWith(\"/home\") && !path.equals(home.getPath())) {\n  throw new KettleException(\"Refusing to move another user's home directory: \" + path);\n}","typeGuard":"boolean isOtherUsersHome(RepositoryDirectoryInterface dir, String currentUser) {\n  String p = dir.getPath();\n  return p.startsWith(\"/home/\") && !p.equals(\"/home/\" + currentUser);\n}","tryCatchPattern":"try {\n  repo.renameRepositoryDirectory(dirId, newParent, newName);\n} catch (RepositoryObjectAccessException e) {\n  if (e.getAccessExceptionType() == RepositoryObjectAccessException.AccessExceptionType.USER_HOME_DIR) {\n    log.warn(\"Skipped home directory\");\n  } else throw e;\n}","preventionTips":["Skip folders under /home in bulk rename/move scripts.","Run home-folder reorganization as an administrator with home-move rights enabled.","Filter the directory tree before presenting folders to users for rename."],"tags":["repository","permission","pentaho","home-directory"],"backgroundTag":"permission-denied","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}