File tree Expand file tree Collapse file tree
src/main/java/com/back/web7_9_codecrete_be/global/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import com .back .web7_9_codecrete_be .domain .users .entity .User ;
44import lombok .Getter ;
55import org .springframework .security .core .GrantedAuthority ;
6+ import org .springframework .security .core .authority .SimpleGrantedAuthority ;
67import org .springframework .security .core .userdetails .UserDetails ;
78
89import java .util .Collection ;
9- import java .util .Collections ;
10+ import java .util .List ;
1011
1112@ Getter
1213public class CustomUserDetail implements UserDetails {
@@ -19,8 +20,9 @@ public CustomUserDetail(User user) {
1920
2021 @ Override
2122 public Collection <? extends GrantedAuthority > getAuthorities () {
22- // 현재 권한 시스템 없으면 빈 리스트
23- return Collections .emptyList ();
23+ return List .of (
24+ new SimpleGrantedAuthority ("ROLE_" + user .getRole ())
25+ );
2426 }
2527
2628 @ Override
You can’t perform that action at this time.
0 commit comments