Class FolderAuthorizationStrategyAPI

java.lang.Object
io.jenkins.plugins.folderauth.FolderAuthorizationStrategyAPI

@ParametersAreNonnullByDefault public class FolderAuthorizationStrategyAPI extends Object
Public-facing methods for modifying FolderBasedAuthorizationStrategy.

These methods should only be called when Jenkins.getAuthorizationStrategy()} is FolderBasedAuthorizationStrategy. This class does not provide REST API methods.

See Also:
  • Method Details

    • addGlobalRole

      public static void addGlobalRole(GlobalRole role)
      Parameters:
      role - the role to be added.
      Throws:
      IllegalArgumentException - when a role with the given name already exists.
    • addFolderRole

      public static void addFolderRole(FolderRole role)
      Parameters:
      role - the role to be added.
      Throws:
      IllegalArgumentException - when a role with the given name already exists.
    • addAgentRole

      public static void addAgentRole(AgentRole role)
      Parameters:
      role - the role to be added.
      Throws:
      IllegalArgumentException - when a role with the given name already exists.
    • assignSidToGlobalRole

      public static void assignSidToGlobalRole(String sid, String roleName)
      Assigns the sid to the GlobalRole identified by roleName.
      Parameters:
      sid - this sid will be assigned to the global role with the name equal to roleName.
      roleName - the name of the global role
      Throws:
      IllegalArgumentException - when no global role with name equal to roleName exists
      IllegalArgumentException - when the sid is empty
    • assignSidToAgentRole

      public static void assignSidToAgentRole(String sid, String roleName)
      Assigns the sid to the AgentRole identified by roleName.
      Parameters:
      sid - this sid will be assigned to the AgentRole with the name equal to roleName.
      roleName - the name of the agent role
      Throws:
      IllegalArgumentException - when no agent role with name equal to roleName exists
      IllegalArgumentException - when the sid is empty
    • assignSidToFolderRole

      public static void assignSidToFolderRole(String sid, String roleName)
      Assigns the sid to the FolderRole identified by roleName.
      Parameters:
      sid - this sid will be assigned to the FolderRole with the name equal to roleName.
      roleName - the name of the folder role
      Throws:
      IllegalArgumentException - when no folder role with name equal to roleName exists
      IllegalArgumentException - when the sid is empty
    • deleteGlobalRole

      public static void deleteGlobalRole(String roleName)
      Deletes the GlobalRole with name equal to roleName.
      Parameters:
      roleName - the name of the role to be deleted
      Throws:
      IllegalArgumentException - when no global role with name equal to roleName exists
    • deleteFolderRole

      public static void deleteFolderRole(String roleName)
      Deletes the FolderRole with name equal to roleName.
      Parameters:
      roleName - the name of the role to be deleted
      Throws:
      IllegalArgumentException - when no role with name equal to roleName exists
    • deleteAgentRole

      public static void deleteAgentRole(String roleName)
      Deletes the AgentRole with name equal to roleName.
      Parameters:
      roleName - the name of the role to be deleted
      Throws:
      IllegalArgumentException - when no role with name equal to roleName exists
    • removeSidFromGlobalRole

      public static void removeSidFromGlobalRole(String sid, String roleName)
      Removes the sid from the GlobalRole with name equal to @{code roleName}.
      Parameters:
      roleName - the name of the role.
      sid - the sid that will be removed.
      Throws:
      IllegalArgumentException - when no GlobalRole with the given roleName exists.
      Since:
      TODO
    • removeSidFromFolderRole

      public static void removeSidFromFolderRole(String sid, String roleName)
      Removes the sid from the FolderRole with name equal to @{code roleName}.
      Parameters:
      roleName - the name of the role.
      sid - the sid that will be removed.
      Throws:
      IllegalArgumentException - when no FolderRole with the given roleName exists.
      Since:
      TODO
    • removeSidFromAgentRole

      public static void removeSidFromAgentRole(String sid, String roleName)
      Removes the sid from the AgentRole with name equal to @{code roleName}.
      Parameters:
      roleName - the name of the role.
      sid - the sid that will be removed.
      Throws:
      IllegalArgumentException - when no AgentRole with the given roleName exists.
      Since:
      TODO