Class ApproverOptions

java.lang.Object
io.jenkins.plugins.batchcontrol.ui.ApproverOptions

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class ApproverOptions extends Object
Computes the approver candidates shown in request forms: the global approver list intersected with the job-level restriction when one is configured (SPEC items 3 and 5).

The current user is filtered out because a requester may not approve their own request — except for administrators when allowAdminSelfApproval is on (SPEC item 2). This is display-side convenience only; RunRequestService re-validates eligibility on submission.

R4-01: ids are compared under the realm's user id strategy (Approvers.sameUser(java.lang.String, java.lang.String)), as the service compares them: a job restriction naming Approver-1 keeps the global approver-1 under a case-insensitive strategy, and the global spelling is offered.

  • Method Details

    • forJob

      public static List<String> forJob(@CheckForNull Job<?,?> job)
      Parameters:
      job - the target job, or null when it no longer exists (falls back to the global list)
      Returns:
      eligible approver ids, possibly empty (the views must then warn "no approvers")