Skip to content

Commit

Permalink
Merge pull request #1030 from ORCID/rollbackBreakingChangesForNotific…
Browse files Browse the repository at this point in the history
…ations

removed user access check for updating member language
  • Loading branch information
auumgn authored Aug 7, 2023
2 parents 5b33731 + a5b9d7f commit 369af8e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ public MemberOrgIds getCurrentMemberOrgIds(String salesforceId) throws Unauthori
}

public void updateMemberDefaultLanguage(String salesforceId, String language) throws UnauthorizedMemberAccessException {
LOG.info("Logged in user is {}, language is {}", userService.getLoggedInUser().getEmail());
validateUserAccess(salesforceId);
Optional<Member> optional = memberRepository.findBySalesforceId(salesforceId);
if (optional.isPresent()) {
Member member = optional.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,6 @@ void testUpdateMemberDefaultLanguage() throws UnauthorizedMemberAccessException
assertThat(captured.getDefaultLanguage()).isEqualTo("en");
}

@Test
void testUpdateMemberDefaultLanguage_illegalAccess() {
Member member = getMember();
Mockito.when(memberRepository.findBySalesforceId(Mockito.eq("wrongSalesforceId"))).thenReturn(Optional.of(member));

Assertions.assertThrows(UnauthorizedMemberAccessException.class, () -> {
memberService.updateMemberDefaultLanguage("wrongSalesforceId", "en");
});
Mockito.verify(memberRepository, Mockito.never()).save(Mockito.any(Member.class));
}

@Test
void testProcessMemberContact_add() throws UnauthorizedMemberAccessException {
Mockito.doNothing().when(mailService).sendUpdateContactEmail(Mockito.any(MemberContactUpdate.class));
Expand Down

0 comments on commit 369af8e

Please sign in to comment.