Skip to content

Commit 5433896

Browse files
committed
fix : authorize if error fix
1 parent 17097ab commit 5433896

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Main/src/main/java/com/seveneleven/util/methodauthorize/ProjectAuthorizationCheckServiceImpl.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.springframework.security.access.AccessDeniedException;
1717
import org.springframework.stereotype.Component;
1818

19+
import java.util.Objects;
1920
import java.util.Optional;
2021

2122
@Component("projectAuthorizationCheckService")
@@ -92,7 +93,7 @@ public boolean checkDeveloperApprover(Long memberId, Long projectId) {
9293
}
9394

9495
private boolean checkCompanyAndAuthorization(
95-
Long memberId, Long projectId, String authorizationCode, String companyCode
96+
Long memberId, Long projectId, String companyCode, String authorizationCode
9697
) {
9798
Member member = memberRepository.findByIdAndStatus(memberId, MemberStatus.ACTIVE)
9899
.orElseThrow(() -> new AccessDeniedException(ErrorCode.NOT_FOUND_MEMBER.getMessage()));
@@ -107,8 +108,8 @@ private boolean checkCompanyAndAuthorization(
107108

108109
if(
109110
authorization.isPresent() &&
110-
authorizationCode.equals(authorization.get().getAuthorizationCode()) &&
111-
company == (companyCode.equals(CUSTOMER) ? project.getCustomer() : project.getDeveloper())
111+
Objects.equals(authorizationCode.toUpperCase(), authorization.get().getAuthorization()) &&
112+
company == (companyCode.equals(CUSTOMER.toLowerCase()) ? project.getCustomer() : project.getDeveloper())
112113
) {
113114
return true;
114115
}

0 commit comments

Comments
 (0)