{"record":{"id":"554f349b24a934e7","repo":"pentaho/pentaho-kettle","slug":"purrepository-error-0005-incorrect-permission","errorCode":"PurRepository.ERROR_0005_INCORRECT_PERMISSION","errorMessage":"PurRepository.ERROR_0005_INCORRECT_PERMISSION (localized, lists missing permissions in [..])","messagePattern":"PurRepository\\.ERROR_0005_INCORRECT_PERMISSION \\(localized, lists missing permissions in \\[\\.\\.\\]\\)","errorType":"exception","errorClass":"KettleSecurityException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":3360,"sourceCode":"  public IRepositoryExporter getExporter() throws KettleException {\n    final List<String> exportPerms =\n      Arrays.asList( IAbsSecurityProvider.CREATE_CONTENT_ACTION, IAbsSecurityProvider.EXECUTE_CONTENT_ACTION );\n    IAbsSecurityProvider securityProvider = purRepositoryServiceRegistry.getService( IAbsSecurityProvider.class );\n    StringBuilder errorMessage = new StringBuilder( \"[\" );\n    for ( String perm : exportPerms ) {\n      if ( securityProvider == null && PurRepositoryConnector.inProcess() ) {\n        return new PurRepositoryExporter( this );\n      }\n      if ( securityProvider != null && securityProvider.isAllowed( perm ) ) {\n        return new PurRepositoryExporter( this );\n      }\n      errorMessage.append( perm );\n      errorMessage.append( \", \" );\n    }\n    errorMessage.setLength( errorMessage.length() - 2 );\n    errorMessage.append( \"]\" );\n\n    throw new KettleSecurityException( BaseMessages.getString( PKG, \"PurRepository.ERROR_0005_INCORRECT_PERMISSION\",\n      errorMessage.toString() ) );\n  }\n\n  @Override\n  public IRepositoryImporter getImporter() {\n    return new PurRepositoryImporter( this );\n  }\n\n  @Override\n  public IUnifiedRepository getUnderlyingRepository() {\n    return pur;\n  }\n\n  @Override\n  public IMetaStore getRepositoryMetaStore() {\n    return metaStore;\n  }\n","sourceCodeStart":3342,"sourceCodeEnd":3378,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L3342-L3378","documentation":"Permission check in PurRepository.getExporter: the current user lacks one or more required actions (create/execute content) to export from the Pentaho repository. The code accumulates the missing permission names into the localized ERROR_0005 message, which lists them in brackets.","triggerScenarios":"Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java:3360 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Grant the user the create-content and execute-content permissions in the BI Server","Perform the export with an account that already holds both permissions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before performing a write operation, verify effective permissions\nIAclHolder holder = /* file or folder */;\nRepositoryFileAcl acl = repo.getAclForObject(folder);\nboolean canWrite = acl != null && repo.hasAccess(folder.getName(), RepositoryFilePermission.WRITE);\nif (!canWrite) {\n  throw new KettleSecurityException(\"User lacks WRITE permission\");\n}","typeGuard":"boolean hasWriteAccess(PurRepository repo, String path) throws KettleException {\n  try {\n    return repo.hasAccess(path, RepositoryFilePermission.WRITE);\n  } catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n  repo.save(element, comment);\n} catch (KettleSecurityException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"ERROR_0005\")) {\n    // request access or retry as admin user\n  } else { throw e; }\n}","preventionTips":["Check permissions with repository.hasAccess() before write/delete operations","Grant required roles in Pentaho Administration before automation runs","Verify object and parent-folder ACLs after ownership changes","Re-check permissions after server upgrades or tenant switches"],"tags":[],"backgroundTag":null,"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"}