"/api/project/**", ROLE_MEMBER 추가
This commit is contained in:
parent
7c3f646b36
commit
2641cb258f
@ -80,10 +80,7 @@ public class SecurityConfig {
|
|||||||
http
|
http
|
||||||
.securityMatcher("/api/**") // '/api/**' 경로에 대해서만 보안 적용
|
.securityMatcher("/api/**") // '/api/**' 경로에 대해서만 보안 적용
|
||||||
.authorizeHttpRequests(auth -> auth
|
.authorizeHttpRequests(auth -> auth
|
||||||
.requestMatchers("/api/project/**").hasRole("MEMBER")
|
.anyRequest().access(authorizationManager) // 모든 요청에 대해 권한 관리
|
||||||
.requestMatchers("/api/**").permitAll() // 특정 엔드포인트 허용
|
|
||||||
.anyRequest().authenticated() // 나머지 요청은 인증 필요
|
|
||||||
//auth.anyRequest().access(authorizationManager) // 모든 요청에 대해 권한 관리
|
|
||||||
)
|
)
|
||||||
// 세션 관리 설정
|
// 세션 관리 설정
|
||||||
.sessionManagement(session ->
|
.sessionManagement(session ->
|
||||||
|
|||||||
@ -28,8 +28,9 @@ public class MapBasedUrlRoleMapper implements UrlRoleMapper{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> getUrlRoleMappings() {
|
public Map<String, String> getUrlRoleMappings() {
|
||||||
urlRoleMappings.put("/api/user/**", ROLE_MEMBER);
|
urlRoleMappings.put("/api/user/**", PERMIT_ALL);
|
||||||
urlRoleMappings.put("/api/test/**", ROLE_MEMBER);
|
urlRoleMappings.put("/api/project/**", ROLE_MEMBER);
|
||||||
|
// urlRoleMappings.put("/api/test/**", ROLE_MEMBER);
|
||||||
|
|
||||||
|
|
||||||
return new HashMap<>(urlRoleMappings);
|
return new HashMap<>(urlRoleMappings);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user