Package io.jenkins.plugins.folderauth
Class FolderAuthorizationStrategyManagementLink
java.lang.Object
hudson.model.ManagementLink
io.jenkins.plugins.folderauth.FolderAuthorizationStrategyManagementLink
- All Implemented Interfaces:
ExtensionPoint,Action,ModelObject
@Extension
@ExportedBean
@ParametersAreNonnullByDefault
public class FolderAuthorizationStrategyManagementLink
extends ManagementLink
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.ManagementLink
ManagementLink.CategoryNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.ManagementLink
LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoAddAgentRole(AgentRoleCreationRequest request) Adds anAgentRoletoFolderBasedAuthorizationStrategy.voiddoAddFolderRole(FolderRoleCreationRequest request) Adds aFolderRoletoFolderBasedAuthorizationStrategy.voiddoAddGlobalRole(GlobalRoleCreationRequest request) Adds aGlobalRoletoFolderBasedAuthorizationStrategy.voiddoAssignSidToAgentRole(String roleName, String sid) voiddoAssignSidToFolderRole(String roleName, String sid) Assignssidto the folder role identified byroleName.voiddoAssignSidToGlobalRole(String roleName, String sid) Assignssidto the global role identified byroleName.voiddoDeleteAgentRole(String roleName) Deletes anAgentRolefrom theFolderBasedAuthorizationStrategy.voiddoDeleteFolderRole(String roleName) Deletes a folder role.voiddoDeleteGlobalRole(String roleName) Deletes a global role.net.sf.json.JSONArrayGet allAbstractFolders in the systemvoiddoRemoveSidFromAgentRole(String roleName, String sid) Removessidfrom the agent role identified byroleName.voiddoRemoveSidFromFolderRole(String roleName, String sid) Removessidfrom the folder role identified byroleName.voiddoRemoveSidFromGlobalRole(String roleName, String sid) Removessidfrom the global role identified byroleName.Get allComputers in the systemgetApi()Returns theApifor the plugin.Name of the category for this management link.Returns theFolderRoles used by theFolderBasedAuthorizationStrategy.Methods inherited from class hudson.model.ManagementLink
all, getBadge, getCategory, getRequiredPermission, getRequiresConfirmation, getRequiresPOST
-
Constructor Details
-
FolderAuthorizationStrategyManagementLink
public FolderAuthorizationStrategyManagementLink()
-
-
Method Details
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction- Specified by:
getIconFileNamein classManagementLink
-
getDescription
- Overrides:
getDescriptionin classManagementLink
-
getUrlName
- Specified by:
getUrlNamein interfaceAction- Specified by:
getUrlNamein classManagementLink
-
getDisplayName
-
getCategoryName
Name of the category for this management link. Exists so that plugins with core dependency pre-dating the version when this was introduced can define a category. TODO when the core version is >2.226 change this to overridegetCategory()instead- Overrides:
getCategoryNamein classManagementLink- Returns:
- name of the desired category, one of the enum values of Category, e.g.
STATUS. - Since:
- 2.226
-
getGlobalPermissions
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Set<Permission> getGlobalPermissions() -
getFolderPermissions
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Set<Permission> getFolderPermissions() -
getAgentPermissions
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Set<Permission> getAgentPermissions() -
getApi
Returns theApifor the plugin.- Returns:
- Api for the plugin.
- See Also:
-
doAddGlobalRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAddGlobalRole(@JsonBody GlobalRoleCreationRequest request) Adds aGlobalRoletoFolderBasedAuthorizationStrategy.- Parameters:
request- the request to create theGlobalRole- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategy
-
doAssignSidToGlobalRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAssignSidToGlobalRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) Assignssidto the global role identified byroleName.- Parameters:
roleName- the name of the global to whichsidwill be assigned to.sid- the sid of the user/group to be assigned.- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyIllegalArgumentException- when no role with name equal toroleNameexists.
-
doAddFolderRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAddFolderRole(@JsonBody FolderRoleCreationRequest request) Adds aFolderRoletoFolderBasedAuthorizationStrategy.- Parameters:
request- the request to create the role- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategy
-
doAddAgentRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAddAgentRole(@JsonBody AgentRoleCreationRequest request) Adds anAgentRoletoFolderBasedAuthorizationStrategy.- Parameters:
request- the request to create the role- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategy
-
doAssignSidToFolderRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAssignSidToFolderRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) Assignssidto the folder role identified byroleName.- Parameters:
roleName- the name of the global to whichsidwill be assigned to.sid- the sid of the user/group to be assigned.- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyNoSuchElementException- when no role with name equal toroleNameexists.
-
doAssignSidToAgentRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAssignSidToAgentRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) - Parameters:
roleName- the name of the global to whichsidwill be assigned to.sid- the sid of the user/group to be assigned.- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyIllegalArgumentException- when no role with name equal toroleNameexists.
-
getGlobalRoles
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public SortedSet<GlobalRole> getGlobalRoles() -
doGetAllFolders
@GET @NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public net.sf.json.JSONArray doGetAllFolders()Get allAbstractFolders in the system- Returns:
- full names of all
AbstractFolders in the system
-
getAllComputers
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<Computer> getAllComputers()Get allComputers in the system- Returns:
- all Computers in the system
-
getFolderRoles
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public SortedSet<FolderRole> getFolderRoles()Returns theFolderRoles used by theFolderBasedAuthorizationStrategy.- Returns:
- the
FolderRoles used by theFolderBasedAuthorizationStrategy - Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategy
-
getAgentRoles
-
doDeleteGlobalRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doDeleteGlobalRole(@QueryParameter(required=true) String roleName) Deletes a global role.- Parameters:
roleName- the name of the role to be deleted- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyIllegalArgumentException- when trying to delete the admin roleIllegalArgumentException- when no role with name equal toroleNameexists.
-
doDeleteFolderRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doDeleteFolderRole(@QueryParameter(required=true) String roleName) Deletes a folder role.- Parameters:
roleName- the name of the role to be deleted- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyIllegalArgumentException- when no role with name equal toroleNameexists.
-
doDeleteAgentRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doDeleteAgentRole(@QueryParameter(required=true) String roleName) Deletes anAgentRolefrom theFolderBasedAuthorizationStrategy.- Parameters:
roleName- the name of the role to be deleted- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyNoSuchElementException- when no role with name equal toroleNameexists.
-
doRemoveSidFromGlobalRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doRemoveSidFromGlobalRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) Removessidfrom the global role identified byroleName.- Parameters:
roleName- the name of the global role from whichsidwill be removed.sid- the sid of the user/group to be assigned.- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyIllegalArgumentException- when no role with name equal toroleNameexists.
-
doRemoveSidFromFolderRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doRemoveSidFromFolderRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) Removessidfrom the folder role identified byroleName.- Parameters:
roleName- the name of the folder role from whichsidwill be removed.sid- the sid of the user/group to be assigned.- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyIllegalArgumentException- when no role with name equal toroleNameexists.
-
doRemoveSidFromAgentRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doRemoveSidFromAgentRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) Removessidfrom the agent role identified byroleName.- Parameters:
roleName- the name of the agent from whichsidwill be removed.sid- the sid of the user/group to be assigned.- Throws:
IllegalStateException- whenJenkins.getAuthorizationStrategy()is notFolderBasedAuthorizationStrategyIllegalArgumentException- when no role with name equal toroleNameexists.
-