Class MoveRefusal

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

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class MoveRefusal extends Failure
D-59: the answer to a move that MoveGuard refused, in the D-48 style: HTTP 403 and a plain message saying what the move needs and what the user is missing. A browser (a request that accepts text/html) gets the class's index.jelly with the standard layout when that view exists; any other caller, and a browser while the view does not exist, gets Throwable.getMessage() as text/plain. Nothing has changed when it is sent.

It is also thrown from the grant layer's Item/Move check; Stapler serves an exception that is an HttpResponse as that response.

See Also:
  • Method Details

    • getDestinationFullName

      public String getDestinationFullName()
      Full name of the group the item was to be moved into, or the empty string for the Jenkins root (which no permission window can cover). The refusal page links the Create window request for it.
    • isDeleteMissing

      public boolean isDeleteMissing()
      Whether the refusal lacks Item/Delete on the item and a Delete window on the item would supply it. false when a missing part cannot come from any window: Delete on an item group that is not a job (D-71), or Create in the Jenkins root (no window names it) or in a group that is not a regular folder. Such a move needs an administrator, so no window is suggested.
    • isCreateMissing

      public boolean isCreateMissing()
      Whether the refusal lacks Item/Create on the destination, either entirely or because the active Create window's name restriction does not admit the item's name; a Create window on getDestinationFullName() that admits the name would supply it. false when the move cannot be authorised through windows at all (see isDeleteMissing()).
    • getItemFullName

      public String getItemFullName()
      Full name of the item whose move was refused.
    • getItemUrl

      @CheckForNull public String getItemUrl()
      For the refusal page's link back to the item: the item's URL relative to the Jenkins root (for example job/prod/job/x/), or null when the current user may not open it. The item is looked up as the current user, so Jenkins' Item/Read rule applies; an item the user can only discover (Item/Discover) gets no link either, since opening it would be refused.
    • 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