Package io.jenkins.plugins.folderauth
Class FolderAuthorizationStrategyAPI
java.lang.Object
io.jenkins.plugins.folderauth.FolderAuthorizationStrategyAPI
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 Summary
Modifier and TypeMethodDescriptionstatic voidaddAgentRole(AgentRole role) Adds anAgentRoleto theFolderBasedAuthorizationStrategy.static voidaddFolderRole(FolderRole role) Adds aFolderRoleto theFolderBasedAuthorizationStrategy.static voidaddGlobalRole(GlobalRole role) Adds aGlobalRoleto theFolderBasedAuthorizationStrategy.static voidassignSidToAgentRole(String sid, String roleName) static voidassignSidToFolderRole(String sid, String roleName) static voidassignSidToGlobalRole(String sid, String roleName) static voiddeleteAgentRole(String roleName) Deletes theAgentRolewith name equal toroleName.static voiddeleteFolderRole(String roleName) Deletes theFolderRolewith name equal toroleName.static voiddeleteGlobalRole(String roleName) Deletes theGlobalRolewith name equal toroleName.static voidremoveSidFromAgentRole(String sid, String roleName) Removes thesidfrom theAgentRolewith name equal to @{code roleName}.static voidremoveSidFromFolderRole(String sid, String roleName) Removes thesidfrom theFolderRolewith name equal to @{code roleName}.static voidremoveSidFromGlobalRole(String sid, String roleName) Removes thesidfrom theGlobalRolewith name equal to @{code roleName}.
-
Method Details
-
addGlobalRole
Adds aGlobalRoleto theFolderBasedAuthorizationStrategy.- Parameters:
role- the role to be added.- Throws:
IllegalArgumentException- when a role with the given name already exists.
-
addFolderRole
Adds aFolderRoleto theFolderBasedAuthorizationStrategy.- Parameters:
role- the role to be added.- Throws:
IllegalArgumentException- when a role with the given name already exists.
-
addAgentRole
Adds anAgentRoleto theFolderBasedAuthorizationStrategy.- Parameters:
role- the role to be added.- Throws:
IllegalArgumentException- when a role with the given name already exists.
-
assignSidToGlobalRole
- Parameters:
sid- this sid will be assigned to the global role with the name equal toroleName.roleName- the name of the global role- Throws:
IllegalArgumentException- when no global role with name equal toroleNameexistsIllegalArgumentException- when thesidis empty
-
assignSidToAgentRole
- Parameters:
sid- this sid will be assigned to theAgentRolewith the name equal toroleName.roleName- the name of the agent role- Throws:
IllegalArgumentException- when no agent role with name equal toroleNameexistsIllegalArgumentException- when thesidis empty
-
assignSidToFolderRole
- Parameters:
sid- this sid will be assigned to theFolderRolewith the name equal toroleName.roleName- the name of the folder role- Throws:
IllegalArgumentException- when no folder role with name equal toroleNameexistsIllegalArgumentException- when thesidis empty
-
deleteGlobalRole
Deletes theGlobalRolewith name equal toroleName.- Parameters:
roleName- the name of the role to be deleted- Throws:
IllegalArgumentException- when no global role with name equal toroleNameexists
-
deleteFolderRole
Deletes theFolderRolewith name equal toroleName.- Parameters:
roleName- the name of the role to be deleted- Throws:
IllegalArgumentException- when no role with name equal toroleNameexists
-
deleteAgentRole
Deletes theAgentRolewith name equal toroleName.- Parameters:
roleName- the name of the role to be deleted- Throws:
IllegalArgumentException- when no role with name equal toroleNameexists
-
removeSidFromGlobalRole
Removes thesidfrom theGlobalRolewith name equal to @{code roleName}.- Parameters:
roleName- the name of the role.sid- the sid that will be removed.- Throws:
IllegalArgumentException- when noGlobalRolewith the givenroleNameexists.- Since:
- TODO
-
removeSidFromFolderRole
Removes thesidfrom theFolderRolewith name equal to @{code roleName}.- Parameters:
roleName- the name of the role.sid- the sid that will be removed.- Throws:
IllegalArgumentException- when noFolderRolewith the givenroleNameexists.- Since:
- TODO
-
removeSidFromAgentRole
Removes thesidfrom theAgentRolewith name equal to @{code roleName}.- Parameters:
roleName- the name of the role.sid- the sid that will be removed.- Throws:
IllegalArgumentException- when noAgentRolewith the givenroleNameexists.- Since:
- TODO
-