diff --git a/CHANGELOG.md b/CHANGELOG.md index 32c510cfe53..79a8393a526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## v2.51.6 - 2024-02-28 + +[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.51.5...v2.51.6) + +## v2.51.5 - 2024-02-28 + +[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.51.4...v2.51.5) + +- [#6999](https://github.com/ORCID/ORCID-Source/pull/6999): lmendoza/wordpress-headless + +## v2.51.4 - 2024-02-27 + +[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.51.3...v2.51.4) + ## v2.51.3 - 2024-02-27 [Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.51.2...v2.51.3) diff --git a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegatorErrorsTest.java b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegatorErrorsTest.java index 96330083161..de34b5c5e6c 100644 --- a/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegatorErrorsTest.java +++ b/orcid-api-web/src/test/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegatorErrorsTest.java @@ -1764,28 +1764,119 @@ public void test3_0() { /** * Deactivated elements tests - */ - @Test - public void testViewDeactivatedRecordDontThrowError() { + */ + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewActivities() { SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewActivities(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewRecord() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewRecord(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewPerson() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewPerson(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewAddresses() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewAddresses(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewEducations() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewEducations(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewEmails() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewEmails(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewEmployments() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewEmployments(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewExternalIdentifiers() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewExternalIdentifiers(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewFundings() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewFundings(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewKeywords() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewKeywords(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewOtherNames() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewOtherNames(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewPeerReviews() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewPeerReviews(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewPersonalDetails() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewPersonalDetails(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewResearcherUrls() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewResearcherUrls(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewResearchResources() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewResearchResources(deactivatedUserOrcid); + fail(); + } + + @Test(expected = DeactivatedException.class) + public void testDeactivatedRecordViewWorks() { + SecurityContextTestUtils.setUpSecurityContext("0000-0000-0000-0007", ScopePathType.READ_LIMITED); serviceDelegator.viewWorks(deactivatedUserOrcid); + fail(); } - + @Test(expected = DeactivatedException.class) public void testDeactivatedRecordCreateWork() { serviceDelegator.createWork(deactivatedUserOrcid, null); diff --git a/orcid-core/src/main/java/org/orcid/core/manager/impl/WorkManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/impl/WorkManagerImpl.java index e3017a17470..342eda67f77 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/impl/WorkManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/impl/WorkManagerImpl.java @@ -355,6 +355,7 @@ public Work updateWork(String orcid, Work work, boolean isApiRequest) { Work workSaved = jpaJaxbWorkAdapter.toWork(workEntity); WorkForm workFormSaved = WorkForm.valueOf(workSaved, maxContributorsForUI); + String devMessage = localeManager.resolveMessage("apiError.9010.developerMessage").replace("${activity}", "work"); if (workFormSaved.compare(WorkForm.valueOf(work, maxContributorsForUI))) { SourceEntity sourceEntity = sourceManager.retrieveSourceEntity(); @@ -362,13 +363,13 @@ public Work updateWork(String orcid, Work work, boolean isApiRequest) { if (sourceEntity.getSourceProfile() != null && sourceEntity.getSourceProfile().getId() != null) { client = sourceEntity.getSourceProfile().getId(); if(!StringUtils.equals(client, orcid) ) { - throw new OrcidForbiddenException(localeManager.resolveMessage("apiError.9010.developerMessage","work")); + throw new OrcidForbiddenException(devMessage ); } } if (sourceEntity.getSourceClient() != null && sourceEntity.getSourceClient().getClientName() != null) { client = sourceEntity.getSourceClient().getClientName(); if(!StringUtils.equals(sourceEntity.getSourceClient().getClientId(), workEntity.getClientSourceId()) ) { - throw new OrcidForbiddenException(localeManager.resolveMessage("apiError.9010.developerMessage","work")); + throw new OrcidForbiddenException(devMessage ); } } LOGGER.info("There is no changes in the work with putCode " + work.getPutCode() + " send it by " + client); diff --git a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/WorkManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/WorkManagerImpl.java index cef0b778523..cdb636c282f 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/WorkManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/v3/impl/WorkManagerImpl.java @@ -375,9 +375,8 @@ public Work updateWork(String orcid, Work work, boolean isApiRequest) { if (workFormSaved.compare(WorkForm.valueOf(work, maxContributorsForUI))) { if (activeSource != null) { - if(!activeSource.equals(workSaved.getSource())) { - throw new OrcidForbiddenException(localeManager.resolveMessage("apiError.9010.developerMessage","work")); + throw new OrcidForbiddenException(localeManager.resolveMessage("apiError.9010.developerMessage").replace("${activity}", "work")); } } diff --git a/orcid-core/src/main/java/org/orcid/core/togglz/Features.java b/orcid-core/src/main/java/org/orcid/core/togglz/Features.java index 1363a5845a9..e82777a7031 100644 --- a/orcid-core/src/main/java/org/orcid/core/togglz/Features.java +++ b/orcid-core/src/main/java/org/orcid/core/togglz/Features.java @@ -6,6 +6,11 @@ public enum Features implements Feature { + + @Label("Homepage Headless WordPress") + WORDPRESS_HOME_PAGE, + + @Label("Registration 2.1: Add affiliations on registration") REGISTRATION_2_1,