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 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 Details
-
addGlobalRole
Adds aGlobalRole
to theFolderBasedAuthorizationStrategy
.- Parameters:
role
- the role to be added.- Throws:
IllegalArgumentException
- when a role with the given name already exists.
-
addFolderRole
Adds aFolderRole
to theFolderBasedAuthorizationStrategy
.- Parameters:
role
- the role to be added.- Throws:
IllegalArgumentException
- when a role with the given name already exists.
-
addAgentRole
Adds anAgentRole
to 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 toroleName
existsIllegalArgumentException
- when thesid
is empty
-
assignSidToAgentRole
- 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
- 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
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
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
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
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
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
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
-