Class RoleStrategyConfig
java.lang.Object
hudson.model.ManagementLink
com.michelin.cio.hudson.plugins.rolestrategy.RoleStrategyConfig
- All Implemented Interfaces:
ExtensionPoint,Action,ModelObject
Add the role management link to the Manage Hudson page.
- Author:
- Thomas Maurel
-
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 TypeMethodDescriptionvoiddoTemplatesSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Called on roles generator form submission.static RoleStrategyConfigget()Get the singleton instance of RoleStrategyConfig.Bootstrap JSON for the Assign Roles page, intended to be embedded in adata-*attribute so the React UI can render immediately without an additional round trip.Deprecated.no longer used internally; retained only for compatibilityThe description of the link.Text displayed in the Manage Hudson panel.final RoleTypeReturns the global role type, used bylist-macros.jellyto evaluate a macro's applicability to global roles.Provides the icon for the Manage Hudson page link.Bootstrap JSON for the Manage Roles page, intended to be embedded in adata-*attribute so the React UI can render immediately without an additional round trip.Deprecated.no longer used internally; retained only for compatibilitystatic intThe number of Assign Roles cards rendered per page, kept configurable via the documentedMAX_ROWSsystem property so large instances can tune it for performance.Bootstrap JSON for the Permission Templates page, intended to be embedded in adata-*attribute so the React UI can render immediately without an additional round trip.final RoleTypeReturns the project role type, used bylist-macros.jellyto evaluate a macro's applicability to item roles.final RoleTypeReturns the slave role type, used bylist-macros.jellyto evaluate a macro's applicability to agent roles.Retrieve theRoleBasedAuthorizationStrategyobject from the Hudson instance.URL name for the strategy management.Methods inherited from class hudson.model.ManagementLink
all, getBadge, getCategory, getRequiresConfirmation, getRequiresPOSTMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Action
getEvent, getGroup, getSemantic, isVisibleInContextMenu
-
Constructor Details
-
RoleStrategyConfig
public RoleStrategyConfig()
-
-
Method Details
-
get
Get the singleton instance of RoleStrategyConfig.- Returns:
- The RoleStrategyConfig instance
-
getIconFileName
Provides the icon for the Manage Hudson page link.- Specified by:
getIconFileNamein interfaceAction- Specified by:
getIconFileNamein classManagementLink- Returns:
- Path to the icon, or
nullif not enabled
-
getRequiredPermission
- Overrides:
getRequiredPermissionin classManagementLink
-
getUrlName
URL name for the strategy management.- Specified by:
getUrlNamein interfaceAction- Specified by:
getUrlNamein classManagementLink- Returns:
- Path to the strategy admin panel
-
getCategoryName
- Overrides:
getCategoryNamein classManagementLink
-
getDisplayName
Text displayed in the Manage Hudson panel.- Returns:
- Link text in the Admin panel
-
getDescription
The description of the link.- Specified by:
getDescriptionin interfaceAction- Overrides:
getDescriptionin classManagementLink- Returns:
- The description of the link
-
getAssignRolesName
Deprecated.no longer used internally; retained only for compatibilityText formerly displayed for the roles assignment panel; kept for binary and source compatibility with external callers now that the panel is rendered by the React Assign Roles page instead of a Jelly view referencing this method.- Returns:
- Title of the Role assignment panel
-
getManageRolesName
Deprecated.no longer used internally; retained only for compatibilityText formerly displayed for the roles management panel; kept for binary and source compatibility with external callers now that the panel is rendered by the React Manage Roles page instead of a Jelly view referencing this method.- Returns:
- Title of the Role management panel
-
getStrategy
Retrieve theRoleBasedAuthorizationStrategyobject from the Hudson instance.Used by the views to build matrix.
- Returns:
- The
RoleBasedAuthorizationStrategyobject.nullif the strategy is not used.
-
doTemplatesSubmit
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doTemplatesSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException Called on roles generator form submission.- Throws:
IOExceptionjakarta.servlet.ServletException
-
getRoleMacroExtensions
-
getPermissionTemplatesBootstrapJson
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getPermissionTemplatesBootstrapJson()Bootstrap JSON for the Permission Templates page, intended to be embedded in adata-*attribute so the React UI can render immediately without an additional round trip.- Returns:
- JSON string with templates, item-scope permission groups, and edit permissions
-
getManageRolesBootstrapJson
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getManageRolesBootstrapJson()Bootstrap JSON for the Manage Roles page, intended to be embedded in adata-*attribute so the React UI can render immediately without an additional round trip.- Returns:
- JSON string with the roles, permission groups and edit permission per role type, plus the permission templates for the item-role dialog
-
getAssignRolesBootstrapJson
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getAssignRolesBootstrapJson()Bootstrap JSON for the Assign Roles page, intended to be embedded in adata-*attribute so the React UI can render immediately without an additional round trip.- Returns:
- JSON string with the roles, sid entries and edit permission per role type
-
getMaxRows
public static int getMaxRows()The number of Assign Roles cards rendered per page, kept configurable via the documentedMAX_ROWSsystem property so large instances can tune it for performance.- Returns:
- the configured page size, defaulting to 50, clamped to between 1 and
RoleBasedAuthorizationStrategy.MAX_SIDS_PER_REQUEST: a value of 0 or less would make client-side pagination invalid, and a page larger than that limit would make every realm-lookup request for a full page (which sends one sid per non-internal entry) fail with400
-
getGlobalRoleType
Returns the global role type, used bylist-macros.jellyto evaluate a macro's applicability to global roles.- Returns:
- the
RoleType.Globalconstant
-
getProjectRoleType
Returns the project role type, used bylist-macros.jellyto evaluate a macro's applicability to item roles.- Returns:
- the
RoleType.Projectconstant
-
getSlaveRoleType
Returns the slave role type, used bylist-macros.jellyto evaluate a macro's applicability to agent roles.- Returns:
- the
RoleType.Slaveconstant
-