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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doAssignSubmit
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Called on role assignment form's submission.doCheckForWhitespace
(String value) Checks if the value contains whitespace at begin or end.doCheckName
(String value) Check the given SID and look it up in the security realm and returns html snippet that will be displayed in the form instead of the plain sid.doCheckPattern
(String value) Validate the pattern.void
doRolesSubmit
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Called on role management form's submission.void
doTemplatesSubmit
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Called on role generator form submission.Create PermissionEntry.Get the needed permissions groups.boolean
hasAmbiguousEntries
(SortedMap<Role, Set<PermissionEntry>> grantedRoles) Returns a String with the permissions that imply the given permission.newInstance
(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData) Method called on Jenkins Manage panel submission, and plugin specific forms to create theAuthorizationStrategy
object.boolean
showPermission
(String type, Permission p) Used from Jelly.Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, 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, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
DescriptorImpl
public DescriptorImpl()
-
-
Method Details
-
getDisplayName
- Overrides:
getDisplayName
in classDescriptor<AuthorizationStrategy>
-
doCheckForWhitespace
Checks if the value contains whitespace at begin or end.- Parameters:
value
- Value to check- Returns:
- FormValidation
-
doRolesSubmit
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doRolesSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException Called on role management form's submission.- Throws:
javax.servlet.ServletException
IOException
-
doAssignSubmit
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doAssignSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException Called on role assignment form's submission.- Throws:
javax.servlet.ServletException
IOException
-
doTemplatesSubmit
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doTemplatesSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException Called on role generator form submission.- Throws:
javax.servlet.ServletException
IOException
-
newInstance
public AuthorizationStrategy newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData) Method called on Jenkins Manage panel submission, and plugin specific forms to create theAuthorizationStrategy
object.- Overrides:
newInstance
in classDescriptor<AuthorizationStrategy>
-
getGroups
Get the needed permissions groups.- Parameters:
type
- Role type- Returns:
- Groups, which should be displayed for a specific role type.
null
if 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
-
entryFor
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public PermissionEntry entryFor(String type, String sid) Create PermissionEntry.- Parameters:
type
- AuthorizationTypesid
- SID- Returns:
- PermissionEntry
-
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
-
doCheckName
Check the given SID and look it up in the security realm and returns html snippet that will be displayed in the form instead of the plain sid.When the name matches an existing user the users full name will be shown, otherwise it will be just the sid. For Existing users and groups, the corresponding icon will be used.
- Parameters:
value
- Name to validate- Returns:
- FormValidation object
-
hasAmbiguousEntries
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public boolean hasAmbiguousEntries(SortedMap<Role, Set<PermissionEntry>> grantedRoles)
-