Enum CredentialsScope
- All Implemented Interfaces:
Serializable
,Comparable<CredentialsScope>
The scope of credentials.
-
Enum Constant Summary
Enum ConstantDescriptionThis credential is available to the object on which the credential is associated and all objects that are children of that object.This credential is only available to the object on which the credential is associated.This credential is available to the user which which the credential is associated. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
Gets the display name for the credentials.abstract boolean
isVisible
(ModelObject context) Tests if credentials with this scope are visible in the supplied context.static CredentialsScope
Returns the enum constant of this type with the specified name.static CredentialsScope[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SYSTEM
This credential is only available to the object on which the credential is associated. Typically you would use SYSTEM scoped credentials for things like email auth, agent connection, etc, i.e. where the Jenkins instance itself is using the credential. -
GLOBAL
This credential is available to the object on which the credential is associated and all objects that are children of that object. Typically you would use GLOBAL scoped credentials for things that are needed byJob
s. -
USER
This credential is available to the user which which the credential is associated. Typically you would use USER scoped credentials where credentials are required for immediate actions. Some examples could include:- Tag this build
- Deploy artifacts to some container NOW
- etc
Another way of looking at this is, if the action is one that is configured from the
Job
's Configure page, then don't use USER scope, as that prevents another user from modifying the job configuration (because they will only be able to see their own credentials)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getDisplayName
Gets the display name for the credentials.- Returns:
- The display name for the credentials.
-
isVisible
Tests if credentials with this scope are visible in the supplied context.- Parameters:
context
- the context.- Returns:
true
if credentials with this scope are visible in the supplied context.- Since:
- 2.1.5
-