Skip to content

Commit b6b9007

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

14 files changed

+122
-0
lines changed

CHANGELOG.md

+4
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

+2
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

+43
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

+1
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

+1
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

+1
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

+1
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

+5
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

+5
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

+5
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

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

+5
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ notification.delegate.receipt.orcidRecord=XX
1313
notification.delegate.receipt.tutorial=XX
1414
notification.delegate.receipt.questions=XX
1515
notification.delegate.receipt.helpDesk=XX
16+
17+
notification.delegate.receipt.revokeTrustedIndividual=XX
18+
notification.delegate.receipt.revokeAccessYourRecord=XX
19+
notification.delegate.receipt.trustedIndividuals=XX
20+
notification.delegate.receipt.revokeConcerns=XX
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<#import "email_macros.ftl" as emailMacros />
2+
3+
<#include "notification_header.ftl"/>
4+
<@emailMacros.msg "notification.share.record" />
5+
6+
${emailNameForDelegate}<@emailMacros.space /><a style="text-decoration: underline;color: #085c77;display: inline-block;" href="${baseUri}/${orcidValueForDelegate}" target="_blank">
7+
(${baseUri}/${orcidValueForDelegate})
8+
</a> <@emailMacros.space /><@emailMacros.msg "notification.delegate.receipt.revokeTrustedIndividual" />.
9+
10+
<@emailMacros.msg "notification.delegate.receipt.revokeAccessYourRecord" /><@emailMacros.space /><a style="text-decoration: underline;color: #085c77;display: inline-block;" href="${baseUri}/trusted-parties" target="_blank">
11+
<@emailMacros.msg "notification.delegate.receipt.trustedIndividuals" />
12+
</a>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<#import "email_macros.ftl" as emailMacros />
2+
<#escape x as x?html>
3+
<!DOCTYPE html>
4+
<html>
5+
<head>
6+
<title>${subject}</title>
7+
</head>
8+
<body>
9+
<#include "notification_header_html.ftl"/>
10+
<p>
11+
<b>${emailNameForDelegate}</b>
12+
<@emailMacros.space />
13+
<a style="text-decoration: underline;color: #085c77;display: inline-block;" href="${baseUri}/${orcidValueForDelegate}" target="_blank">
14+
(${baseUri}/${orcidValueForDelegate})
15+
</a>
16+
<@emailMacros.space />
17+
<@emailMacros.msg "notification.delegate.receipt.revokeTrustedIndividual" />
18+
<p>
19+
<@emailMacros.msg "notification.delegate.receipt.revokeAccessYourRecord" /><@emailMacros.space />
20+
<@emailMacros.space /><a style="text-decoration: underline;color: #085c77;display: inline-block;" href="${baseUri}/trusted-parties" target="_blank">
21+
<@emailMacros.msg "notification.delegate.receipt.trustedIndividuals" />
22+
</a>
23+
</p>
24+
<#include "notification_footer_html.ftl"/>
25+
</body>
26+
</html>
27+
</#escape>

orcid-web/src/main/java/org/orcid/frontend/web/controllers/ManageProfileController.java

+10
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ public class ManageProfileController extends BaseWorkspaceController {
135135

136136
@Resource
137137
private SlackManager slackManager;
138+
139+
@Resource(name = "notificationManagerV3")
140+
private NotificationManager notificationManager;
138141

139142
@RequestMapping
140143
public ModelAndView manageProfile() {
@@ -218,6 +221,13 @@ public ModelAndView manageProfile() {
218221
givenPermissionToManager.remove(getCurrentUserOrcid(), manageDelegate.getDelegateToManage());
219222
return manageDelegate;
220223
}
224+
225+
@RequestMapping(value = "/revokeOwnPermission.json", method = RequestMethod.POST)
226+
public @ResponseBody ManageDelegate revokeOwnDelegate(@RequestBody ManageDelegate manageDelegate) {
227+
givenPermissionToManager.remove(manageDelegate.getDelegateToManage(),getCurrentUserOrcid());
228+
notificationManager.sendRevokeNotificationToUserGrantingPermission(manageDelegate.getDelegateToManage(),getCurrentUserOrcid());
229+
return manageDelegate;
230+
}
221231

222232
@RequestMapping(value = "/socialAccounts.json", method = RequestMethod.GET)
223233
public @ResponseBody List<UserconnectionEntity> getSocialAccountsJson(HttpServletRequest request) {

0 commit comments

Comments
 (0)