Class SelfGrantRevertedFailure

All Implemented Interfaces:
Serializable, org.kohsuke.stapler.HttpResponse

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class SelfGrantRevertedFailure extends Failure
Tells the saving user that the guard reverted the authorization part of their save (SPEC item 2, D-48, D-58a, D-58b): the item is guarded because a permission window covers it or it was changed under one and not yet reviewed, so a widening of its authorization is undone whoever saves it. The rest of the save was kept. The text says how the guard ends (Mark as reviewed) and, for a viewer who may open it, links the job's Batch Control page (DEF-39).

Answers HTTP 403. A browser (a request that accepts text/html) gets index.jelly with the standard layout; any other caller (a config.xml POST, createItem from a script) gets Throwable.getMessage() as plain text. Only the item's full name is kept (the exception is Serializable); it is escaped on the page and written as text/plain otherwise. It never changes state.

See Also:
  • Constructor Details

    • SelfGrantRevertedFailure

      public SelfGrantRevertedFailure(Item item)
      Parameters:
      item - the item whose authorization entries the guard restored
  • Method Details

    • getReviewPageUrl

      @CheckForNull public String getReviewPageUrl()
      DEF-39: the root-relative URL of the job's Batch Control page, where "Mark as reviewed" is offered, when the viewer may open it (the page exists only for a job, and only for a BatchControl/Request holder who may read the job); else null.
    • getItemFullName

      public String getItemFullName()
    • generateResponse

      public void generateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object node, @CheckForNull Throwable throwable) throws IOException, jakarta.servlet.ServletException
      Overrides:
      generateResponse in class Failure
      Throws:
      IOException
      jakarta.servlet.ServletException
    • generateResponse

      public void generateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object node) throws IOException, jakarta.servlet.ServletException
      Specified by:
      generateResponse in interface org.kohsuke.stapler.HttpResponse
      Overrides:
      generateResponse in class Failure
      Throws:
      IOException
      jakarta.servlet.ServletException