Jhipster权限控制

来源:互联网 发布:如何用vb编写上位机 编辑:程序博客网 时间:2024/06/01 21:37

com.cloud.gate.config.MicroserviceSecurityConfiguration.java

public void configure(HttpSecurity http) throws Exception {    http        .csrf()        .ignoringAntMatchers("/h2-console/**")        .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())    .and()        .addFilterBefore(corsFilter, CsrfFilter.class)        .headers()        .frameOptions()        .disable()    .and()        .sessionManagement()        .sessionCreationPolicy(SessionCreationPolicy.STATELESS)    .and()        .authorizeRequests()        .antMatchers("/api/profile-info").permitAll()        .antMatchers("/api/**").authenticated()        .antMatchers("/management/health").permitAll()        .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN)        .antMatchers("/swagger-resources/configuration/ui").permitAll();}
原创粉丝点击