Record Class InputPermissions

java.lang.Object
java.lang.Record
io.jenkins.plugins.pipelinegraphview.utils.InputPermissions

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public record InputPermissions(boolean canProceed, boolean canAbort) extends Record
What the current user can do with an input step a run is waiting on.

Graphs and steps are cached and shared by every user, so these are worked out per request and added to the JSON as it's written, as canProceed and canAbort on each inputStep.

  • Constructor Summary

    Constructors
    Constructor
    Description
    InputPermissions(boolean canProceed, boolean canAbort)
    Creates an instance of a InputPermissions record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    apply(tools.jackson.databind.JsonNode json, Map<String,InputPermissions> permissions)
    Sets canProceed and canAbort on every inputStep in the JSON.
    boolean
    Returns the value of the canAbort record component.
    boolean
    Returns the value of the canProceed record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    forCurrentUser(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
    The current user's permissions for each input the run is waiting on, by input id.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • InputPermissions

      public InputPermissions(boolean canProceed, boolean canAbort)
      Creates an instance of a InputPermissions record class.
      Parameters:
      canProceed - the value for the canProceed record component
      canAbort - the value for the canAbort record component
  • Method Details

    • forCurrentUser

      public static Map<String,InputPermissions> forCurrentUser(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
      The current user's permissions for each input the run is waiting on, by input id.
    • apply

      public static void apply(tools.jackson.databind.JsonNode json, Map<String,InputPermissions> permissions)
      Sets canProceed and canAbort on every inputStep in the JSON.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • canProceed

      public boolean canProceed()
      Returns the value of the canProceed record component.
      Returns:
      the value of the canProceed record component
    • canAbort

      public boolean canAbort()
      Returns the value of the canAbort record component.
      Returns:
      the value of the canAbort record component