/** * {@inheritDoc} */ @Override public Set<CredentialsScope> getScopes(ModelObject object) { if (object instanceof Jenkins || object instanceof SystemCredentialsProvider) { return SCOPES; } return super.getScopes(object); }
/** * {@inheritDoc} */ @Override public Set<CredentialsScope> getScopes(ModelObject object) { if (object instanceof User) { return SCOPES; } return super.getScopes(object); }
/** * {@inheritDoc} */ @Override public Set<CredentialsScope> getScopes(ModelObject object) { if (object instanceof AbstractFolder) { return SCOPES; } return super.getScopes(object); }
/** * {@inheritDoc} */ @Override public Set<CredentialsScope> getScopes(ModelObject object) { if (object instanceof AbstractFolder) { return SCOPES; } return super.getScopes(object); }
/** * {@inheritDoc} */ @Override public Set<CredentialsScope> getScopes(ModelObject object) { if (object instanceof Jenkins || object instanceof SystemCredentialsProvider) { return SCOPES; } return super.getScopes(object); }
/** * {@inheritDoc} */ @Override public Set<CredentialsScope> getScopes(ModelObject object) { if (object instanceof User) { return SCOPES; } return super.getScopes(object); }
/** * Returns the {@link CredentialsScope} instances that are applicable to this store. * @return the {@link CredentialsScope} instances that are applicable to this store or {@code null} if the store * instance is no longer enabled. * * @since 2.1.5 */ @Nullable public final Set<CredentialsScope> getScopes() { CredentialsProvider provider = getProvider(); return provider == null ? null : provider.getScopes(getContext()); }
/** * Returns the {@link CredentialsScope} instances that are applicable to this store. * @return the {@link CredentialsScope} instances that are applicable to this store or {@code null} if the store * instance is no longer enabled. * * @since 2.1.5 */ @Nullable public final Set<CredentialsScope> getScopes() { CredentialsProvider provider = getProvider(); return provider == null ? null : provider.getScopes(getContext()); }
/** * Returns the scopes allowed for credentials stored within the specified object or {@code null} if the * object is not relevant for scopes and the object's container should be considered instead. * * @param object the object. * @return the set of scopes that are relevant for the object or {@code null} if the object is not a credentials * container. */ @CheckForNull public static Set<CredentialsScope> lookupScopes(ModelObject object) { object = CredentialsDescriptor.unwrapContext(object); Set<CredentialsScope> result = null; for (CredentialsProvider provider : all()) { if (provider.isEnabled(object)) { try { Set<CredentialsScope> scopes = provider.getScopes(object); if (scopes != null) { // if multiple providers for the same object, then combine scopes if (result == null) { result = new LinkedHashSet<CredentialsScope>(); } result.addAll(scopes); } } catch (NoClassDefFoundError e) { // ignore optional dependency } } } return result; }
/** * Returns the scopes allowed for credentials stored within the specified object or {@code null} if the * object is not relevant for scopes and the object's container should be considered instead. * * @param object the object. * @return the set of scopes that are relevant for the object or {@code null} if the object is not a credentials * container. */ @CheckForNull public static Set<CredentialsScope> lookupScopes(ModelObject object) { object = CredentialsDescriptor.unwrapContext(object); Set<CredentialsScope> result = null; for (CredentialsProvider provider : all()) { if (provider.isEnabled(object)) { try { Set<CredentialsScope> scopes = provider.getScopes(object); if (scopes != null) { // if multiple providers for the same object, then combine scopes if (result == null) { result = new LinkedHashSet<CredentialsScope>(); } result.addAll(scopes); } } catch (NoClassDefFoundError e) { // ignore optional dependency } } } return result; }