public ListBoxModel doFillCredentialsIdItems(@AncestorInPath SCMSourceOwner owner, @QueryParameter String source) { if (!hasAccessToCredentialsMetadata(owner)) { return new ListBoxModel(); } return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(availableCredentials(owner, source)); }
public ListBoxModel doFillGlobalCredentialsIdItems() { Job owner = null; List<DomainRequirement> apiEndpoint = URIRequirementBuilder.fromUri(BitbucketApi.OAUTH_ENDPOINT).build(); return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class, owner, null, apiEndpoint)); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Job<?,?> owner, @QueryParameter String source) { if (!hasAccessToCredentialsMetadata(owner)) { return new ListBoxModel(); } return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(availableCredentials(owner, new EnvVars( ).expand( source ))); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context, @QueryParameter String url) { AccessControlled _context = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); if (_context == null || !_context.hasPermission(Jenkins.ADMINISTER)) { return new StandardUsernameListBoxModel(); } return new StandardUsernameListBoxModel() .withEmptySelection() .withAll( CredentialsProvider.lookupCredentials( StandardUsernamePasswordCredentials.class, Jenkins.getInstance(), ACL.SYSTEM, URIRequirementBuilder.fromUri(url).build() ) ); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Job<?,?> owner) { if (owner == null || !owner.hasPermission(Item.CONFIGURE)) { return new ListBoxModel(); } List<DomainRequirement> apiEndpoint = URIRequirementBuilder.fromUri(BitbucketApi.OAUTH_ENDPOINT).build(); return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class, owner, null, apiEndpoint)); }