Package io.jenkins.plugins.folderauth
Class FolderAuthorizationStrategyAPI
- java.lang.Object
-
- io.jenkins.plugins.folderauth.FolderAuthorizationStrategyAPI
-
@ParametersAreNonnullByDefault public class FolderAuthorizationStrategyAPI extends Object
Public-facing methods for modifyingFolderBasedAuthorizationStrategy
.These methods should only be called when
Jenkins.getAuthorizationStrategy()
} isFolderBasedAuthorizationStrategy
. This class does not provide REST API methods.- See Also:
for REST API methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addAgentRole(AgentRole role)
Adds anAgentRole
to theFolderBasedAuthorizationStrategy
.static void
addFolderRole(FolderRole role)
Adds aFolderRole
to theFolderBasedAuthorizationStrategy
.static void
addGlobalRole(GlobalRole role)
Adds aGlobalRole
to theFolderBasedAuthorizationStrategy
.static void
assignSidToAgentRole(String sid, String roleName)
static void
assignSidToFolderRole(String sid, String roleName)
static void
assignSidToGlobalRole(String sid, String roleName)
static void
deleteAgentRole(String roleName)
Deletes theAgentRole
with name equal toroleName
.static void
deleteFolderRole(String roleName)
Deletes theFolderRole
with name equal toroleName
.static void
deleteGlobalRole(String roleName)
Deletes theGlobalRole
with name equal toroleName
.static void
removeSidFromAgentRole(String sid, String roleName)
Removes thesid
from theAgentRole
with name equal to @{code roleName}.static void
removeSidFromFolderRole(String sid, String roleName)
Removes thesid
from theFolderRole
with name equal to @{code roleName}.static void
removeSidFromGlobalRole(String sid, String roleName)
Removes thesid
from theGlobalRole
with name equal to @{code roleName}.
-
-
-
Method Detail
-
addGlobalRole
public static void addGlobalRole(GlobalRole role)
Adds aGlobalRole
to theFolderBasedAuthorizationStrategy
.- 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)
Adds aFolderRole
to theFolderBasedAuthorizationStrategy
.- 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)
Adds anAgentRole
to theFolderBasedAuthorizationStrategy
.- 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)
- 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 toroleName
existsIllegalArgumentException
- when thesid
is empty
-
assignSidToAgentRole
public static void assignSidToAgentRole(String sid, String roleName)
- Parameters:
sid
- this sid will be assigned to theAgentRole
with the name equal toroleName
.roleName
- the name of the agent role- Throws:
IllegalArgumentException
- when no agent role with name equal toroleName
existsIllegalArgumentException
- when thesid
is empty
-
assignSidToFolderRole
public static void assignSidToFolderRole(String sid, String roleName)
- Parameters:
sid
- this sid will be assigned to theFolderRole
with the name equal toroleName
.roleName
- the name of the folder role- Throws:
IllegalArgumentException
- when no folder role with name equal toroleName
existsIllegalArgumentException
- when thesid
is empty
-
deleteGlobalRole
public static void deleteGlobalRole(String roleName)
Deletes theGlobalRole
with name equal toroleName
.- Parameters:
roleName
- the name of the role to be deleted- Throws:
IllegalArgumentException
- when no global role with name equal toroleName
exists
-
deleteFolderRole
public static void deleteFolderRole(String roleName)
Deletes theFolderRole
with name equal toroleName
.- Parameters:
roleName
- the name of the role to be deleted- Throws:
IllegalArgumentException
- when no role with name equal toroleName
exists
-
deleteAgentRole
public static void deleteAgentRole(String roleName)
Deletes theAgentRole
with name equal toroleName
.- Parameters:
roleName
- the name of the role to be deleted- Throws:
IllegalArgumentException
- when no role with name equal toroleName
exists
-
removeSidFromGlobalRole
public static void removeSidFromGlobalRole(String sid, String roleName)
Removes thesid
from theGlobalRole
with name equal to @{code roleName}.- Parameters:
roleName
- the name of the role.sid
- the sid that will be removed.- Throws:
IllegalArgumentException
- when noGlobalRole
with the givenroleName
exists.- Since:
- TODO
-
removeSidFromFolderRole
public static void removeSidFromFolderRole(String sid, String roleName)
Removes thesid
from theFolderRole
with name equal to @{code roleName}.- Parameters:
roleName
- the name of the role.sid
- the sid that will be removed.- Throws:
IllegalArgumentException
- when noFolderRole
with the givenroleName
exists.- Since:
- TODO
-
removeSidFromAgentRole
public static void removeSidFromAgentRole(String sid, String roleName)
Removes thesid
from theAgentRole
with name equal to @{code roleName}.- Parameters:
roleName
- the name of the role.sid
- the sid that will be removed.- Throws:
IllegalArgumentException
- when noAgentRole
with the givenroleName
exists.- Since:
- TODO
-
-