Skip to content

Commit

Permalink
Merge pull request #159 from themoment-team/fix/profileImgSecurityConfig
Browse files Browse the repository at this point in the history
기본 이미지 변경 API 권한, 로직 설정
  • Loading branch information
tlsgmltjd committed May 24, 2024
2 parents 9cec890 + 70685a4 commit 67a58f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class User(
val snsUrl: String?,

@Column(nullable = true)
val profileUrl: String?,
var profileUrl: String?,

@Column(name = "default_img_number")
var defaultImgNumber: Int = 0,
Expand Down Expand Up @@ -65,6 +65,10 @@ class User(

fun updateProfileNumber(defaultImgNumber: Int) {
this.defaultImgNumber = defaultImgNumber

if (this.profileUrl != null) {
this.profileUrl = null
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ class SecurityConfig(
Authority.USER.name,
Authority.TEACHER.name
)
// /user/profile-number
.mvcMatchers("/api/v1/user/profile-number").hasAnyRole(
Authority.TEMP_USER.name,
Authority.USER.name,
Authority.TEACHER.name
)
// /user
.mvcMatchers("/api/v1/user/**").hasAnyRole(
Authority.USER.name,
Expand Down

0 comments on commit 67a58f7

Please sign in to comment.