<commit_before>package com.board.gd.config;

import com.board.gd.auth.EmailAuthenticationProvider;
import com.board.gd.domain.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * Created by gd.godong9 on 2017. 4. 6.
 */

@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    @Autowired
    private UserService userService;

    @Autowired
    private EmailAuthenticationProvider userAuthenticationProvider;

    @Autowired
    public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception {
        auth
                .authenticationProvider(userAuthenticationProvider)
                .userDetailsService(userService).passwordEncoder(new BCryptPasswordEncoder());
    }

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.csrf().disable()
                .authorizeRequests()
                .antMatchers(HttpMethod.OPTIONS, "/**").access("permitAll")
                .antMatchers("/admin/**").hasRole("ADMIN")
                .antMatchers("/companies/**").access("permitAll")
                .antMatchers("/users/login", "/users/signup", "/users/email", "/users/*/auth", "/users/data").access("permitAll")
                .antMatchers("/users/password", "/users/find/password").access("permitAll")
                .antMatchers("/stocks/**").hasRole("USER")
                .antMatchers("/users/**").hasRole("USER")
                .antMatchers("/payments/**").hasRole("USER")
                .antMatchers("/boards/**").hasRole("PAID")
                .antMatchers("/posts/**").hasRole("PAID")
                .antMatchers("/comments/**").hasRole("PAID");
    }
}<commit_msg>[Server] PAID 권한 USER 권한으로 변경<commit_after>package com.board.gd.config;

import com.board.gd.auth.EmailAuthenticationProvider;
import com.board.gd.domain.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * Created by gd.godong9 on 2017. 4. 6.
 */

@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    @Autowired
    private UserService userService;

    @Autowired
    private EmailAuthenticationProvider userAuthenticationProvider;

    @Autowired
    public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception {
        auth
                .authenticationProvider(userAuthenticationProvider)
                .userDetailsService(userService).passwordEncoder(new BCryptPasswordEncoder());
    }

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.csrf().disable()
                .authorizeRequests()
                .antMatchers(HttpMethod.OPTIONS, "/**").access("permitAll")
                .antMatchers("/admin/**").hasRole("ADMIN")
                .antMatchers("/companies/**").access("permitAll")
                .antMatchers("/users/login", "/users/signup", "/users/email", "/users/*/auth", "/users/data").access("permitAll")
                .antMatchers("/users/password", "/users/find/password").access("permitAll")
                .antMatchers("/stocks/**").hasRole("USER")
                .antMatchers("/users/**").hasRole("USER")
                .antMatchers("/payments/**").hasRole("USER")
                .antMatchers("/boards/**").hasRole("USER")
                .antMatchers("/posts/**").hasRole("USER")
                .antMatchers("/comments/**").hasRole("USER");
    }
}
{'fraction_non_alphanumeric': 0.13288288288288289, 'fraction_numerical': 0.003153153153153153, 'mean_word_length': 3.458835341365462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2494073', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1127, 'n_words': 161}