Klasse FilePermissionEnforcer

java.lang.Object
io.jenkins.plugins.prism.FilePermissionEnforcer

public class FilePermissionEnforcer extends Object
Enforces security restrictions for viewing files in Jenkins. Some plugins copy source code files to Jenkins' build folder so that these files can be rendered in the user interface together with build results (coverage, warnings, etc.). If these files are not part of the workspace of a build then Jenkins will not show them by default: otherwise sensitive files could be shown by accident. You can provide a list of additional source code directories that are allowed to be shown in Jenkins user interface here. Note, that such a directory must be an absolute path on the agent that executes the build.
Autor:
Ullrich Hafner
  • Konstruktordetails

    • FilePermissionEnforcer

      public FilePermissionEnforcer()
  • Methodendetails

    • isInWorkspace

      public boolean isInWorkspace(String fileName, FilePath workspace, String... permittedDirectories)
      Checks whether the specified file is part of Jenkins' workspace or one of the permitted directories.
      Parameter:
      fileName - the file name of the source
      workspace - the workspace on the agent, files within that folder are always permitted
      permittedDirectories - additional permitted directories
      Gibt zurück:
      true if the file is in the workspace, false otherwise
    • isInWorkspace

      public boolean isInWorkspace(String fileName, FilePath workspace, Set<String> permittedDirectories)
      Checks whether the specified file is part of Jenkins' workspace or one of the permitted directories.
      Parameter:
      fileName - the file name of the source
      workspace - the workspace on the agent, files within that folder are always permitted
      permittedDirectories - an additional set of permitted directories
      Gibt zurück:
      true if the file is in the workspace, false otherwise