Skip to content

Commit b6b9007

Browse files
authored
Merge branch 'main' into lmendoza/404-redirects
2 parents 153a272 + d8db775 commit b6b9007

14 files changed

+122
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v2.76.0 - 2025-03-25
2+
3+
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.75.0...v2.76.0)
4+
15
## v2.75.0 - 2025-03-25
26

37
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.74.0...v2.75.0)

orcid-core/src/main/java/org/orcid/core/manager/v3/NotificationManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public interface NotificationManager {
2020
void sendNotificationToAddedDelegate(String userGrantingPermission, String userReceivingPermission);
2121

2222
void sendNotificationToUserGrantingPermission(String userGrantingPermission, String userReceivingPermission);
23+
24+
void sendRevokeNotificationToUserGrantingPermission(String userGrantingPermission, String userReceivingPermission);
2325

2426
Notification sendAmendEmail(String userOrcid, AmendedSection amendedSection, Collection<Item> activities);
2527

orcid-core/src/main/java/org/orcid/core/manager/v3/impl/NotificationManagerImpl.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,49 @@ public void sendNotificationToUserGrantingPermission(String userGrantingPermissi
341341
notification.setBodyText(text);
342342
createNotification(userGrantingPermission, notification);
343343
}
344+
345+
346+
@Override
347+
public void sendRevokeNotificationToUserGrantingPermission(String userGrantingPermission, String userReceivingPermission) {
348+
ProfileEntity userGrantingProfileEntity = profileEntityCacheManager.retrieve(userGrantingPermission);
349+
String emailName = recordNameManagerV3.deriveEmailFriendlyName(userGrantingPermission);
350+
351+
Locale userLocale = getUserLocaleFromProfileEntity(userGrantingProfileEntity);
352+
353+
String subject = messages.getMessage("email.subject.delegate.revoked", new String[] { emailName }, userLocale);
354+
String emailNameForDelegate = recordNameManagerV3.deriveEmailFriendlyName(userReceivingPermission);
355+
356+
org.orcid.jaxb.model.v3.release.record.Email primaryEmail = emailManager.findPrimaryEmail(userGrantingPermission);
357+
String grantingOrcidEmail = primaryEmail.getEmail();
358+
String assetsUrl = getAssetsUrl();
359+
Map<String, Object> templateParams = new HashMap<String, Object>();
360+
templateParams.put("emailName", emailName);
361+
templateParams.put("orcidValue", userGrantingPermission);
362+
templateParams.put("emailNameForDelegate", emailNameForDelegate);
363+
templateParams.put("orcidValueForDelegate", userReceivingPermission);
364+
templateParams.put("grantingOrcidValue", userGrantingPermission);
365+
templateParams.put("grantingOrcidName", recordNameManagerV3.deriveEmailFriendlyName(userGrantingPermission));
366+
templateParams.put("baseUri", orcidUrlManager.getBaseUrl());
367+
templateParams.put("baseUriHttp", orcidUrlManager.getBaseUriHttp());
368+
templateParams.put("grantingOrcidEmail", grantingOrcidEmail);
369+
templateParams.put("subject", subject);
370+
templateParams.put("assetsUrl", assetsUrl);
371+
372+
addMessageParams(templateParams, userLocale);
373+
374+
// Generate body from template
375+
String text = templateManager.processTemplate("delegate_revoke_notification.ftl", templateParams);
376+
// Generate html from template
377+
String html = templateManager.processTemplate("delegate_revoke_notification_html.ftl", templateParams);
378+
379+
NotificationAdministrative notification = new NotificationAdministrative();
380+
notification.setNotificationType(NotificationType.ADMINISTRATIVE);
381+
notification.setSubject(subject);
382+
notification.setBodyHtml(html);
383+
notification.setBodyText(text);
384+
createNotification(userGrantingPermission, notification);
385+
}
386+
344387

345388
public String createEmailBaseUrl(String unencryptedParams, String baseUri, String path) {
346389
// Encrypt and encode params

orcid-core/src/main/resources/i18n/email_subject_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ email.subject.reactivatingAccount=[ORCID] Reactivating your ORCID account
2121
email.subject.register.welcome=[ORCID] Welcome to ORCID - verify your email address
2222
email.subject.delegate.recipient=[ORCID] You've made an Account Delegate!
2323
email.subject.add_works=[ORCID] Add Research Outputs to your ORCID record
24+
email.subject.delegate.revoked=[ORCID] {0} has revoked their Account Delegate access to your record

orcid-core/src/main/resources/i18n/email_subject_lr.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ email.subject.reactivation=LR
2121
email.subject.reactivatingAccount=LR
2222
email.subject.register.welcome=LR
2323
email.subject.delegate.recipient=LR
24+
email.subject.delegate.revoked=LR

orcid-core/src/main/resources/i18n/email_subject_rl.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ email.subject.reactivation=RL
2121
email.subject.reactivatingAccount=RL
2222
email.subject.register.welcome=RL
2323
email.subject.delegate.recipient=RL
24+
email.subject.delegate.revoked=RL

orcid-core/src/main/resources/i18n/email_subject_xx.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ email.subject.reactivation=X
2121
email.subject.reactivatingAccount=X
2222
email.subject.register.welcome=X
2323
email.subject.delegate.recipient=X
24+
email.subject.delegate.revoked=X

orcid-core/src/main/resources/i18n/notification_delegate_en.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ notification.delegate.receipt.tutorial=For a tutorial on the functions that you
1212
notification.delegate.receipt.questions=If you have questions or concerns about being an Account Delegate, please contact
1313
notification.delegate.receipt.helpDesk=or the ORCID Help Desk at
1414

15+
notification.delegate.receipt.revokeTrustedIndividual=has revoked their Account Delegate access to your ORCID record
16+
notification.delegate.receipt.revokeAccessYourRecord=They can no longer access or manage information on your record and have been removed from your list of
17+
notification.delegate.receipt.trustedIndividuals=Trusted Individuals
18+
notification.delegate.receipt.revokeConcerns=If you have questions or concerns about account delegation, please contact the ORCID Help Desk at
19+

orcid-core/src/main/resources/i18n/notification_delegate_lr.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ notification.delegate.receipt.orcidRecord=LR
1313
notification.delegate.receipt.tutorial=LR
1414
notification.delegate.receipt.questions=LR
1515
notification.delegate.receipt.helpDesk=LR
16+
17+
notification.delegate.receipt.revokeTrustedIndividual=LR
18+
notification.delegate.receipt.revokeAccessYourRecord=LR
19+
notification.delegate.receipt.trustedIndividuals=LR
20+
notification.delegate.receipt.revokeConcerns=LR

orcid-core/src/main/resources/i18n/notification_delegate_rl.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ notification.delegate.receipt.orcidRecord=RL
1313
notification.delegate.receipt.tutorial=RL
1414
notification.delegate.receipt.questions=RL
1515
notification.delegate.receipt.helpDesk=RL
16+
17+
notification.delegate.receipt.revokeTrustedIndividual=RL
18+
notification.delegate.receipt.revokeAccessYourRecord=RL
19+
notification.delegate.receipt.trustedIndividuals=RL
20+
notification.delegate.receipt.revokeConcerns=RL

0 commit comments

Comments
 (0)