/** * Gets the {@link hudson.model.Item} most closely associated with the supplied {@link SubTask}. * * @param t the {@link SubTask}. * @return the {@link hudson.model.Item} associated with the {@link SubTask} or {@code null} if this * {@link SubTask} is not associated with an {@link hudson.model.Item} * @since TODO */ @CheckForNull public static hudson.model.Item getItemOf(@Nonnull SubTask t) { // TODO move to default method on SubTask once code level is Java 8 Queue.Task p = Tasks.getOwnerTaskOf(t); while (!(p instanceof hudson.model.Item)) { Queue.Task o = Tasks.getOwnerTaskOf(p); if (o == p) { break; } p = o; } return p instanceof hudson.model.Item ? (hudson.model.Item) p : null; }
/** * Checks if the current user has a permission to stop this build. */ public boolean hasStopPermission() { Queue.Executable e = executable; return e!=null && Tasks.getOwnerTaskOf(getParentOf(e)).hasAbortPermission(); }
/** * Checks if the current user has a permission to stop this build. */ public boolean hasStopPermission() { Queue.Executable e = executable; return e != null && Tasks.getOwnerTaskOf(getParentOf(e)).hasAbortPermission(); }
/** * Checks if the current user has a permission to stop this build. */ public boolean hasStopPermission() { Queue.Executable e = executable; return e!=null && Tasks.getOwnerTaskOf(getParentOf(e)).hasAbortPermission(); }
/** * Checks if the current user has a permission to stop this build. */ public boolean hasStopPermission() { Queue.Executable e = executable; return e!=null && Tasks.getOwnerTaskOf(getParentOf(e)).hasAbortPermission(); }
/** * Stops the current build. */ public void doStop( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { Queue.Executable e = executable; if(e!=null) { Tasks.getOwnerTaskOf(getParentOf(e)).checkAbortPermission(); interrupt(); } rsp.forwardToPreviousPage(req); }
/** * Stops the current build. */ public void doStop( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { Queue.Executable e = executable; if(e!=null) { Tasks.getOwnerTaskOf(getParentOf(e)).checkAbortPermission(); interrupt(); } rsp.forwardToPreviousPage(req); }
/** * Stops the current build. */ public void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Queue.Executable e = executable; if (e != null) { Tasks.getOwnerTaskOf(getParentOf(e)).checkAbortPermission(); interrupt(); } rsp.forwardToPreviousPage(req); }
/** * Stops the current build. */ public void doStop( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { Queue.Executable e = executable; if(e!=null) { Tasks.getOwnerTaskOf(getParentOf(e)).checkAbortPermission(); interrupt(); } rsp.forwardToPreviousPage(req); }