Class CredentialsSelectHelper
java.lang.Object
hudson.model.Descriptor<CredentialsSelectHelper>
com.cloudbees.plugins.credentials.CredentialsSelectHelper
- All Implemented Interfaces:
Describable<CredentialsSelectHelper>,Saveable,Loadable,OnMaster
@Extension
public class CredentialsSelectHelper
extends Descriptor<CredentialsSelectHelper>
implements Describable<CredentialsSelectHelper>
A descriptor used to assist the c:select tag with allowing in-place addition of credentials.
- Author:
- Stephen Connolly
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn extension point to allow plugging in additional resolution ofModelObjectinstances.static classACredentialsSelectHelper.ContextResolverforIteminstances resolvable byJenkins.getItemByFullName(String).static final classValue class to hold the details of aCredentialsStore.static classstatic classACredentialsSelectHelper.ContextResolverforUserinstances.static final classStapler binding forCredentialsSelectHelper.ContextResolver.static final classStapler binding for aCredentialsSelectHelper.ContextResolverandCredentialsProvider.static final classStapler binding for aCredentialsStore.Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PermissionExpose theCredentialsProvider.CREATEpermission for Jelly.Fields inherited from class hudson.model.Descriptor
clazz -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String, CredentialsProvider> Returns a map of theCredentialsProviderinstances keyed by their name.getResolver(String className) Stapler binding for the resolver URL segment.Returns a map of theCredentialsSelectHelper.ContextResolverinstances keyed by their name.getStoreItems(ModelObject context, boolean includeUser) Returns theCredentialsSelectHelper.StoreIteminstances for the current Stapler request.booleanhasCreatePermission(ModelObject context, boolean includeUser) Checks if the current user has permission to create a credential.resolveContext(Object context) Fixes up the context in case we are called from a page where the context is not a ModelObject.static CredentialsStoreresolveForCLI(String storeId) Resolves aCredentialsStoreinstance for CLI commands.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, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Field Details
-
CREATE
Expose theCredentialsProvider.CREATEpermission for Jelly.
-
-
Constructor Details
-
CredentialsSelectHelper
public CredentialsSelectHelper()Constructor.- See Also:
-
-
Method Details
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<CredentialsSelectHelper>
-
getDisplayName
- Overrides:
getDisplayNamein classDescriptor<CredentialsSelectHelper>
-
resolveContext
@CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public ModelObject resolveContext(Object context) Fixes up the context in case we are called from a page where the context is not a ModelObject.- Parameters:
context- the initial guess of the context.- Returns:
- the resolved context.
- Since:
- 2.0.7
-
getStoreItems
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<CredentialsSelectHelper.StoreItem> getStoreItems(ModelObject context, boolean includeUser) Returns theCredentialsSelectHelper.StoreIteminstances for the current Stapler request.- Parameters:
context- the context in which to retrieve the store items.includeUser-trueto also include any User scoped stores.- Returns:
- the
CredentialsSelectHelper.StoreIteminstances for the current Stapler request. - Since:
- 2.0.5
-
hasCreatePermission
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean hasCreatePermission(ModelObject context, boolean includeUser) Checks if the current user has permission to create a credential.- Parameters:
context- the context.includeUser- whether they can use their own credentials store.- Returns:
trueif they can create a permission.- Since:
- FIXME
-
getResolver
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public CredentialsSelectHelper.WrappedContextResolver getResolver(String className) Stapler binding for the resolver URL segment.- Parameters:
className- the class name of the resolver.- Returns:
- the wrapped resolver.
- Since:
- 2.0
-
resolveForCLI
@CLIResolver public static CredentialsStore resolveForCLI(String storeId) throws org.kohsuke.args4j.CmdLineException Resolves aCredentialsStoreinstance for CLI commands.- Parameters:
storeId- the store identifier.- Returns:
- the
CredentialsStoreinstance. - Throws:
org.kohsuke.args4j.CmdLineException- if the store cannot be resolved.- Since:
- 2.1.1
-
getResolversByName
Returns a map of theCredentialsSelectHelper.ContextResolverinstances keyed by their name. A resolver may have more than one entry if there are inferred unique short nicknames.- Returns:
- a map of the
CredentialsSelectHelper.ContextResolverinstances keyed by their name - Since:
- 2.1.1
-
getProvidersByName
Returns a map of theCredentialsProviderinstances keyed by their name. A provider may have more than one entry if there are inferred unique short nicknames.- Returns:
- a map of the
CredentialsProviderinstances keyed by their name - Since:
- 2.1.1
-