Class JobVisibility

java.lang.Object
io.jenkins.plugins.dorametrics.JobVisibility

public final class JobVisibility extends Object
Decides which recorded pipelines the current user may see. Build data is stored by job name, outside the Jenkins item tree, so every read has to apply the job's own Item/Read permission: Overall/Read alone says nothing about what a user may see inside a folder or a restricted job.
  • Method Details

    • canRead

      public static boolean canRead(String jobFullName)
      Whether the current user may see data recorded for this job. Administrators see everything, including jobs that no longer exist. Everyone else needs Item/Read on a job that still exists, so a missing job and a job the user may not read look the same. getItemByFullName already returns null for a job the user may not read. It also matches names case-insensitively, so the job it finds has to carry exactly the recorded name.
    • isRecordedJob

      public static boolean isRecordedJob(Item item, String recordedName)
      True when the item found for a recorded name is a job with exactly that name.
    • hiddenFromCurrentUser

      public static Set<String> hiddenFromCurrentUser(MetricsStore store)
      Full names of recorded jobs the current user may not see. Resolved once per request, because one dashboard page asks for it many times.
    • excludedForEveryone

      public static Set<String> excludedForEveryone(DoraGlobalConfiguration config, MetricsStore store)
      Everything the job settings leave out for everyone: jobs the job filters do not track, and disabled pipelines when that option is on.
    • excludedForCurrentUser

      public static Set<String> excludedForCurrentUser(DoraGlobalConfiguration config, MetricsStore store)
      Everything to leave out of what the current user is shown: what the job settings leave out for everyone, plus jobs the user may not see.