Class ChangeControlledRelocationHandler

java.lang.Object
com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler
io.jenkins.plugins.batchcontrol.security.ChangeControlledRelocationHandler
All Implemented Interfaces:
ExtensionPoint

@Extension(ordinal=10000.0) @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class ChangeControlledRelocationHandler extends com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler
D-59: puts MoveGuard in front of every move the folders plugin performs. The plugin's move/move hands the move to the chain of RelocationHandlers that do not answer RelocationHandler.HandlingMode.SKIP, highest ordinal first, and the standard handler at the end of that chain is what calls Items.move. This handler is first in the chain while change control is on and passes the move on only when the guard allows it; it never offers a destination or makes the Move action available (RelocationHandler.HandlingMode.DELEGATE). It works whatever authorization strategy is installed. With change control off it is skipped and moves behave as in Jenkins.

D-59a: when run control is on as well and the mover is not an administrator, every job the move took along (the item, or every job inside a moved folder) starts over like a new job once the move has completed (MoveGuard.startOver(hudson.model.Item, java.lang.String, java.lang.String)).

  • Constructor Details

    • ChangeControlledRelocationHandler

      public ChangeControlledRelocationHandler()
  • Method Details

    • applicability

      @NonNull public com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler.HandlingMode applicability(@NonNull Item item)
      Specified by:
      applicability in class com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler
    • handle

      @CheckForNull public org.kohsuke.stapler.HttpResponse handle(@NonNull Item item, @NonNull ItemGroup<?> destination, @NonNull AtomicReference<Item> newItem, @NonNull List<? extends com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler> chain) throws IOException, InterruptedException
      Specified by:
      handle in class com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler
      Throws:
      IOException
      InterruptedException
    • validDestinations

      @NonNull public List<? extends ItemGroup<?>> validDestinations(@NonNull Item item)
      Specified by:
      validDestinations in class com.cloudbees.hudson.plugins.folder.relocate.RelocationHandler