Class MoveRefusal
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
hudson.model.Failure
io.jenkins.plugins.batchcontrol.security.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 Summary
Modifier and TypeMethodDescriptionvoidgenerateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object node) voidgenerateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object node, Throwable throwable) 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).Full name of the item whose move was refused.For the refusal page's link back to the item: the item's URL relative to the Jenkins root (for examplejob/prod/job/x/), ornullwhen the current user may not open it.booleanWhether 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 ongetDestinationFullName()that admits the name would supply it.booleanWhether the refusal lacks Item/Delete on the item and a Delete window on the item would supply it.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.kohsuke.stapler.HttpResponse
generateResponse
-
Method Details
-
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.falsewhen 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 ongetDestinationFullName()that admits the name would supply it.falsewhen the move cannot be authorised through windows at all (seeisDeleteMissing()). -
getItemFullName
Full name of the item whose move was refused. -
getItemUrl
For the refusal page's link back to the item: the item's URL relative to the Jenkins root (for examplejob/prod/job/x/), ornullwhen 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:
generateResponsein classFailure- Throws:
IOExceptionjakarta.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:
generateResponsein interfaceorg.kohsuke.stapler.HttpResponse- Overrides:
generateResponsein classFailure- Throws:
IOExceptionjakarta.servlet.ServletException
-