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 class
An extension point to allow plugging in additional resolution ofModelObject
instances.static class
ACredentialsSelectHelper.ContextResolver
forItem
instances resolvable byJenkins.getItemByFullName(String)
.static final class
Value class to hold the details of aCredentialsStore
.static class
static class
ACredentialsSelectHelper.ContextResolver
forUser
instances.static final class
Stapler binding forCredentialsSelectHelper.ContextResolver
.static final class
Stapler binding for aCredentialsSelectHelper.ContextResolver
andCredentialsProvider
.static final class
Stapler binding for aCredentialsStore
.Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Permission
Expose theCredentialsProvider.CREATE
permission 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 theCredentialsProvider
instances keyed by their name.getResolver
(String className) Stapler binding for the resolver URL segment.Returns a map of theCredentialsSelectHelper.ContextResolver
instances keyed by their name.getStoreItems
(ModelObject context, boolean includeUser) Returns theCredentialsSelectHelper.StoreItem
instances for the current Stapler request.boolean
hasCreatePermission
(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 CredentialsStore
resolveForCLI
(String storeId) Resolves aCredentialsStore
instance 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.CREATE
permission for Jelly.
-
-
Constructor Details
-
CredentialsSelectHelper
public CredentialsSelectHelper()
-
-
Method Details
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<CredentialsSelectHelper>
-
getDisplayName
- Overrides:
getDisplayName
in 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.StoreItem
instances for the current Stapler request.- Parameters:
context
- the context in which to retrieve the store items.includeUser
-true
to also include any User scoped stores.- Returns:
- the
CredentialsSelectHelper.StoreItem
instances 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:
true
if 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 aCredentialsStore
instance for CLI commands.- Parameters:
storeId
- the store identifier.- Returns:
- the
CredentialsStore
instance. - Throws:
org.kohsuke.args4j.CmdLineException
- if the store cannot be resolved.- Since:
- 2.1.1
-
getResolversByName
Returns a map of theCredentialsSelectHelper.ContextResolver
instances 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.ContextResolver
instances keyed by their name - Since:
- 2.1.1
-
getProvidersByName
Returns a map of theCredentialsProvider
instances keyed by their name. A provider may have more than one entry if there are inferred unique short nicknames.- Returns:
- a map of the
CredentialsProvider
instances keyed by their name - Since:
- 2.1.1
-