Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit af44e9c

Browse files
authoredMar 26, 2025··
Merge branch 'main' into 9708-add-lastmodified-column-to-the-dwprofileinfoforspamcheck
2 parents 8c34045 + 0aa8ef8 commit af44e9c

16 files changed

+152
-5
lines changed
 

‎CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## v2.76.1 - 2025-03-25
2+
3+
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.76.0...v2.76.1)
4+
5+
- [#7261](https://github.com/ORCID/ORCID-Source/pull/7261): 404-redirects
6+
7+
## v2.76.0 - 2025-03-25
8+
9+
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.75.0...v2.76.0)
10+
11+
## v2.75.0 - 2025-03-25
12+
13+
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.74.0...v2.75.0)
14+
115
## v2.74.0 - 2025-03-25
216

317
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.73.7...v2.74.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) {

‎orcid-web/src/main/resources/orcid-frontend-security.xml

+8-5
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,14 @@
418418
access="ROLE_USER" />
419419
<sec:intercept-url pattern="/2FA/authenticationCode.json(\?.*)?"
420420
access="ROLE_USER" />
421-
<sec:intercept-url pattern="/2FA/submitCode.json(\?.*)?"
422-
access="ROLE_USER" />
423-
<sec:intercept-url pattern="/.*" method="POST" access="ROLE_USER"/>
424-
425-
421+
<sec:intercept-url pattern="/2FA/submitCode.json(\?.*)?"
422+
access="ROLE_USER" />
423+
424+
<!-- Allow GET requests (no authentication needed) -->
425+
<sec:intercept-url pattern="/.*" method="GET" access="IS_AUTHENTICATED_ANONYMOUSLY" />
426+
<!-- Require ROLE_USER for all other methods -->
427+
<sec:intercept-url pattern="/.*" access="ROLE_USER" />
428+
426429
<sec:form-login login-processing-url="/signin/auth.json" authentication-details-source-ref="authenticationDetailsSource"
427430
login-page="${org.orcid.core.baseUri}/signin" authentication-success-handler-ref="ajaxAuthenticationSuccessHandler"
428431
authentication-failure-handler-ref="ajaxAuthenticationFailureHandler"

‎properties/development.properties

+12
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,18 @@ org.orcid.core.utils.cache.papi.redis.port=6379
289289
org.orcid.core.utils.cache.papi.redis.password=xxxx
290290
org.orcid.core.utils.cache.papi.redis.enabled=true
291291

292+
# CSRF Cookie settings
292293
org.orcid.core.csrf.domain=dev.orcid.org
293294
org.orcid.scheduler.web.processOrgsForIndexing=0 48 12 * * *
294295
org.orcid.admin.registry.url:https://dev.orcid.org
296+
297+
# Redis to hold session data
298+
org.orcid.core.session.cookie.domain=dev.orcid.org
299+
org.orcid.core.utils.cache.session.redis.host=xxxx
300+
org.orcid.core.utils.cache.session.redis.port=6379
301+
org.orcid.core.utils.cache.session.redis.password=xxxx
302+
org.orcid.core.utils.cache.session.redis.pool.idle.max=10
303+
org.orcid.core.utils.cache.session.redis.pool.max=10
304+
org.orcid.core.utils.cache.session.redis.pool.wait.millis=1000
305+
org.orcid.core.utils.cache.session.redis.connection_timeout_millis=1000
306+
org.orcid.core.utils.cache.session.redis.session.timeout=600

0 commit comments

Comments
 (0)
Please sign in to comment.