Class RoleBasedAuthorizationStrategy.DescriptorImpl
java.lang.Object
hudson.model.Descriptor<AuthorizationStrategy>
com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy.DescriptorImpl
- Enclosing class:
RoleBasedAuthorizationStrategy
public static final class RoleBasedAuthorizationStrategy.DescriptorImpl
extends Descriptor<AuthorizationStrategy>
Descriptor used to bind the strategy to the Web forms.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self -
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoCheckForWhitespace(String value) Checks if the value contains whitespace at begin or end.doCheckPattern(String value) Validate the pattern.doCheckSidName(String value, String type) Looks a sid up in the security realm and returns an html snippet, with icon and resolved display name, that the Assign Roles dialog shows below the name field.voiddoTemplatesSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Called on role generator form submission.Get the needed permissions groups.Returns a String with the permissions that imply the given permission.newInstance(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) Method called on Jenkins Manage panel submission, and plugin specific forms to create theAuthorizationStrategyobject.booleanshowPermission(String type, Permission p) Used from Jelly.Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
DescriptorImpl
public DescriptorImpl()
-
-
Method Details
-
getDisplayName
- Overrides:
getDisplayNamein classDescriptor<AuthorizationStrategy>
-
doCheckForWhitespace
Checks if the value contains whitespace at begin or end.- Parameters:
value- Value to check- Returns:
- FormValidation
-
doTemplatesSubmit
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doTemplatesSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws jakarta.servlet.ServletException, IOException Called on role generator form submission.- Throws:
jakarta.servlet.ServletExceptionIOException
-
newInstance
public AuthorizationStrategy newInstance(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) Method called on Jenkins Manage panel submission, and plugin specific forms to create theAuthorizationStrategyobject.- Overrides:
newInstancein classDescriptor<AuthorizationStrategy>
-
getGroups
Get the needed permissions groups.- Parameters:
type- Role type- Returns:
- Groups, which should be displayed for a specific role type.
nullif an unsupported type is defined.
-
showPermission
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean showPermission(String type, Permission p) Used from Jelly.- Parameters:
type- Role typep- Permission- Returns:
- true if permission should be shown
-
impliedByList
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public String impliedByList(Permission p) Returns a String with the permissions that imply the given permission.- Parameters:
p- Permission- Returns:
- String with implying permission
-
doCheckPattern
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public FormValidation doCheckPattern(@QueryParameter String value) Validate the pattern.- Parameters:
value- Pattern to validate- Returns:
- FormValidation object with result
-
doCheckSidName
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public FormValidation doCheckSidName(@QueryParameter String value, @QueryParameter String type) Looks a sid up in the security realm and returns an html snippet, with icon and resolved display name, that the Assign Roles dialog shows below the name field.Missing sids render struck through but still validate OK: an assignment for a sid the realm cannot resolve (e.g. a group from an external directory) is legal.
- Parameters:
value- the sid to look uptype- USER or GROUP- Returns:
- FormValidation whose message is the html snippet
-