Class StrategyMigration

java.lang.Object
io.jenkins.plugins.batchcontrol.security.StrategyMigration

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class StrategyMigration extends Object
Copies between a plain supported strategy and its Batch Control subclass (D-35a, D-35d): the migration action and its reverse. Both are explicit administrator actions; nothing is converted when a configuration is loaded (D-35e removed the withdrawn wrapper and its load conversion).

matrix-auth and role-strategy are optional, and either or both may be missing (S-03). This class refers to core types only. Strategies are recognised by class name, the plugin is checked to be installed, and only then is the per-plugin holder (MatrixStrategies or RoleStrategies) called. Those holders return core types, so verifying this class never loads a class of either plugin.

  • Method Details

    • isMigratable

      public static boolean isMigratable(@CheckForNull AuthorizationStrategy strategy)
      Whether strategy is exactly one of the plain strategies the migration action copies: matrix-auth's project matrix or global matrix, or role-strategy's class. Subclasses by other plugins are not copied: their extra state would be lost.
    • isPerItemWidening

      public static boolean isPerItemWidening(@CheckForNull AuthorizationStrategy strategy)
      Whether migrating strategy makes per-item authorization properties effective (S-04, D-35d): matrix-auth's global matrix ignores job, folder and agent properties, and the Batch Control matrix is project-based, so stale properties would start to count and native Item/Configure holders could edit item ACLs.
    • toBatchControl

      @CheckForNull public static AuthorizationStrategy toBatchControl(@CheckForNull AuthorizationStrategy strategy)
      The Batch Control subclass with every entry of strategy, or null when isMigratable(hudson.security.AuthorizationStrategy) is false or the plugin is not installed. The argument is not modified. An explicit administrator action (the monitor's migration button); for the global matrix see isPerItemWidening(hudson.security.AuthorizationStrategy).
    • toPlain

      @CheckForNull public static AuthorizationStrategy toPlain(@CheckForNull AuthorizationStrategy strategy)
      The plain parent strategy with every entry of a Batch Control strategy, or null if it is not one.