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.Category
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.ManagementLink
LIST
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doAddAgentRole
(AgentRoleCreationRequest request) Adds anAgentRole
toFolderBasedAuthorizationStrategy
.void
doAddFolderRole
(FolderRoleCreationRequest request) Adds aFolderRole
toFolderBasedAuthorizationStrategy
.void
doAddGlobalRole
(GlobalRoleCreationRequest request) Adds aGlobalRole
toFolderBasedAuthorizationStrategy
.void
doAssignSidToAgentRole
(String roleName, String sid) void
doAssignSidToFolderRole
(String roleName, String sid) Assignssid
to the folder role identified byroleName
.void
doAssignSidToGlobalRole
(String roleName, String sid) Assignssid
to the global role identified byroleName
.void
doDeleteAgentRole
(String roleName) Deletes anAgentRole
from theFolderBasedAuthorizationStrategy
.void
doDeleteFolderRole
(String roleName) Deletes a folder role.void
doDeleteGlobalRole
(String roleName) Deletes a global role.net.sf.json.JSONArray
Get allAbstractFolder
s in the systemvoid
doRemoveSidFromAgentRole
(String roleName, String sid) Removessid
from the agent role identified byroleName
.void
doRemoveSidFromFolderRole
(String roleName, String sid) Removessid
from the folder role identified byroleName
.void
doRemoveSidFromGlobalRole
(String roleName, String sid) Removessid
from the global role identified byroleName
.Get allComputer
s in the systemgetApi()
Returns theApi
for the plugin.Name of the category for this management link.Returns theFolderRole
s 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:
getIconFileName
in interfaceAction
- Specified by:
getIconFileName
in classManagementLink
-
getDescription
- Overrides:
getDescription
in classManagementLink
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
- Specified by:
getUrlName
in 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:
getCategoryName
in 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 theApi
for the plugin.- Returns:
- Api for the plugin.
- See Also:
-
doAddGlobalRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAddGlobalRole(@JsonBody GlobalRoleCreationRequest request) Adds aGlobalRole
toFolderBasedAuthorizationStrategy
.- 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) Assignssid
to the global role identified byroleName
.- Parameters:
roleName
- the name of the global to whichsid
will be assigned to.sid
- the sid of the user/group to be assigned.- Throws:
IllegalStateException
- whenJenkins.getAuthorizationStrategy()
is notFolderBasedAuthorizationStrategy
IllegalArgumentException
- when no role with name equal toroleName
exists.
-
doAddFolderRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAddFolderRole(@JsonBody FolderRoleCreationRequest request) Adds aFolderRole
toFolderBasedAuthorizationStrategy
.- 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 anAgentRole
toFolderBasedAuthorizationStrategy
.- 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) Assignssid
to the folder role identified byroleName
.- Parameters:
roleName
- the name of the global to whichsid
will be assigned to.sid
- the sid of the user/group to be assigned.- Throws:
IllegalStateException
- whenJenkins.getAuthorizationStrategy()
is notFolderBasedAuthorizationStrategy
NoSuchElementException
- when no role with name equal toroleName
exists.
-
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 whichsid
will be assigned to.sid
- the sid of the user/group to be assigned.- Throws:
IllegalStateException
- whenJenkins.getAuthorizationStrategy()
is notFolderBasedAuthorizationStrategy
IllegalArgumentException
- when no role with name equal toroleName
exists.
-
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 allAbstractFolder
s in the system- Returns:
- full names of all
AbstractFolder
s in the system
-
getAllComputers
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<Computer> getAllComputers()Get allComputer
s in the system- Returns:
- all Computers in the system
-
getFolderRoles
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public SortedSet<FolderRole> getFolderRoles()Returns theFolderRole
s used by theFolderBasedAuthorizationStrategy
.- Returns:
- the
FolderRole
s 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 notFolderBasedAuthorizationStrategy
IllegalArgumentException
- when trying to delete the admin roleIllegalArgumentException
- when no role with name equal toroleName
exists.
-
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 notFolderBasedAuthorizationStrategy
IllegalArgumentException
- when no role with name equal toroleName
exists.
-
doDeleteAgentRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doDeleteAgentRole(@QueryParameter(required=true) String roleName) Deletes anAgentRole
from theFolderBasedAuthorizationStrategy
.- Parameters:
roleName
- the name of the role to be deleted- Throws:
IllegalStateException
- whenJenkins.getAuthorizationStrategy()
is notFolderBasedAuthorizationStrategy
NoSuchElementException
- when no role with name equal toroleName
exists.
-
doRemoveSidFromGlobalRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doRemoveSidFromGlobalRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) Removessid
from the global role identified byroleName
.- Parameters:
roleName
- the name of the global role from whichsid
will be removed.sid
- the sid of the user/group to be assigned.- Throws:
IllegalStateException
- whenJenkins.getAuthorizationStrategy()
is notFolderBasedAuthorizationStrategy
IllegalArgumentException
- when no role with name equal toroleName
exists.
-
doRemoveSidFromFolderRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doRemoveSidFromFolderRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) Removessid
from the folder role identified byroleName
.- Parameters:
roleName
- the name of the folder role from whichsid
will be removed.sid
- the sid of the user/group to be assigned.- Throws:
IllegalStateException
- whenJenkins.getAuthorizationStrategy()
is notFolderBasedAuthorizationStrategy
IllegalArgumentException
- when no role with name equal toroleName
exists.
-
doRemoveSidFromAgentRole
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doRemoveSidFromAgentRole(@QueryParameter(required=true) String roleName, @QueryParameter(required=true) String sid) Removessid
from the agent role identified byroleName
.- Parameters:
roleName
- the name of the agent from whichsid
will be removed.sid
- the sid of the user/group to be assigned.- Throws:
IllegalStateException
- whenJenkins.getAuthorizationStrategy()
is notFolderBasedAuthorizationStrategy
IllegalArgumentException
- when no role with name equal toroleName
exists.
-