Skip to content

Commit

Permalink
[feature/#209] policy 관련 보안설정
Browse files Browse the repository at this point in the history
  • Loading branch information
whitem4rk committed Jan 7, 2024
1 parent 5d157df commit b8ddc04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class WebSecurityConfig {
private static final String[] AUTH_WHITELIST_SIGNUP = {"/signUp/schedule", "/signUp/questionnaires",
"/signUp/majorInfo"};
private static final String[] AUTH_WHITELIST_CLUB = {"/club/histories", "/club/history/**"};
private static final String[] AUTH_WHITELIST_POLICY = {"/policy/**"};

@Order(1)
@EnableGlobalMethodSecurity(prePostEnabled = true, jsr250Enabled = true)
Expand All @@ -70,6 +71,7 @@ public void configure(AuthenticationManagerBuilder auth) throws Exception {
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.antMatchers(HttpMethod.GET, AUTH_WHITELIST_POLICY)
.antMatchers(HttpMethod.GET, AUTH_WHITELIST_SIGNUP)
.antMatchers(HttpMethod.GET, AUTH_WHITELIST_CLUB)
.antMatchers(AUTH_WHITELIST_SWAGGER)
Expand Down Expand Up @@ -126,6 +128,9 @@ protected void configure(HttpSecurity http) throws Exception {
// 동아리 연혁 수정
.antMatchers("/club/history/**").hasRole(EXECUTIVES.toString())

// 정책 수정
.antMatchers(HttpMethod.PUT, "/policy/**").hasAnyRole(CHIEF.toString(), VICE_CHIEF.toString())

// 그 외
.anyRequest().hasRole(ANONYMOUS.toString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public abstract class BaseEntity {
@Column(nullable = false, updatable = false, insertable = false, columnDefinition = "DATETIME(0) DEFAULT CURRENT_TIMESTAMP")
private LocalDateTime dateCreated;

@CreatedDate
@LastModifiedDate
@Column(columnDefinition = "DATETIME(0)")
private LocalDateTime dateUpdated;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class PolicyTerm extends BaseEntity {
private Content content;

@Builder
public PolicyTerm(PolicyType policyType, Content content) {
public PolicyTerm(PolicyType policyType, String content) {
this.policyType = policyType;
this.content = content;
this.content = new Content(content);
}

public void updatePolicyTerm(SavePolicyTernDto savePolicyTernDto) {
Expand Down

0 comments on commit b8ddc04

Please sign in to comment.