Class CredentialsSelectHelper

    • Constructor Detail

      • CredentialsSelectHelper

        public CredentialsSelectHelper()
    • Method Detail

      • 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
      • 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 a CredentialsStore 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
      • getProvidersByName

        public static Map<String,​CredentialsProvider> getProvidersByName()
        Returns a map of the CredentialsProvider 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