title: Dynamic url for antMancher in ResouraseServerConfiger
body: <p>How to get db data when loading the application using h2 db in  Spring Resourse configuration  and pass that data for  antMatcher and access.</p>
  
  <p>Ex:
  public class ResourceServerConfig extends ResourceServerConfigurerAdapter {</p>
  
  <p>public void configure(HttpSecurity http) throws Exception {</p>
  
  <pre><code>    System.out.println(dataSource.getConnection());
      //here i am getting db object
      http.requestMatchers().and().authorizeRequests()
      .antMatchers("/bitcash/profile/find-user**").access("hasRole('ROLE_USER')")
      .antMatchers("/bitcash/profile/find-admin**").access("hasRole('ROLE_ADMIN')").and()
              .exceptionHandling().accessDeniedHandler(new OAuth2AccessDeniedHandler());
  
      http.csrf().disable();
      http.headers().frameOptions().disable();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>please help me out of it.</p>
  
  <p>public void configure(HttpSecurity http) throws Exception {</p>
  
  <pre><code>    System.out.println(repo.getResourse());
      System.out.println(dataSource.getConnection());
  
      http.requestMatchers().and().authorizeRequests()
      .antMatchers("/bitcash/profile/find-user**").access("hasRole('ROLE_USER')")
      .antMatchers("/bitcash/profile/find-admin**").access("hasRole('ROLE_ADMIN')").and()
              .exceptionHandling().accessDeniedHandler(new OAuth2AccessDeniedHandler());
  
      http.csrf().disable();
      http.headers().frameOptions().disable();
  }
  </code></pre>