아장아장 개발 일기

Spring Security ‘hasAnyAuthority()’ VS ‘hasAnyRole()’ 본문

개발/Spring

Spring Security ‘hasAnyAuthority()’ VS ‘hasAnyRole()’

빨간머리 마녀 🍒 2022. 4. 21. 17:29

‘hasAnyRole()’을 사용하려면 role enum 클래스에 롤 이름이 ‘Role_’ 접두사와 함께 쓰여야합니다.


‘hasAnyAuthority()’는 접두사 없이 사용합니다.

Role큰 개념의 역할을 의미하는 반면, Authority는 보다 작은 기능 단위의 권한을 의미합니다.



참고 : https://minholee93.tistory.com/entry/Spring-Security-Authorities-Role

Comments