@Override public boolean consentsGloballyEnabled() { return !this.consentManager.getSystemConsents().isEmpty(); }
@Override public boolean consentsGloballyEnabled() { return !this.consentManager.getSystemConsents().isEmpty(); }
@Override public boolean authorizeInteraction(Set<String> grantedConsents) { Set<Consent> systemConsents = this.consentManager.getSystemConsents(); if (CollectionUtils.isEmpty(systemConsents)) { return true; } if (CollectionUtils.isEmpty(grantedConsents)) { return containsRequiredConsents(systemConsents); } Set<Consent> missingConsents = new HashSet<>(); for (Consent consent : systemConsents) { if (!grantedConsents.contains(consent.getId())) { missingConsents.add(consent); } } return containsRequiredConsents(missingConsents); }
@Override public boolean authorizeInteraction(Set<String> grantedConsents) { Set<Consent> systemConsents = this.consentManager.getSystemConsents(); if (CollectionUtils.isEmpty(systemConsents)) { return true; } if (CollectionUtils.isEmpty(grantedConsents)) { return containsRequiredConsents(systemConsents); } Set<Consent> missingConsents = new HashSet<>(); for (Consent consent : systemConsents) { if (!grantedConsents.contains(consent.getId())) { missingConsents.add(consent); } } return containsRequiredConsents(missingConsents); }
response.put(ShareProtocol.SERVER_JSON_GETINFO_KEY_NAME_UPDATESENABLED, true); response.put(ShareProtocol.SERVER_JSON_GETINFO_KEY_NAME_CONSENTS, this.consentManager.toJSON(this.consentManager.getSystemConsents()));