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