Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Barrio_1
  2. Barrio_2
  3. Barrio_3
  4. Barrio_4
  5.  
  6. usuario_1 (tendria que poder ver barrio_1 y 2)
  7. usuario_2 (tendria que poder ver barrio_3)
  8. usuario_3 (tendria que poder barrio 2 y 4)
  9.  
  10. ROLE_BARRIO_1
  11. ROLE_BARRIO_2
  12. ROLE_BARRIO_3
  13. ROLE_BARRIO_4
  14.  
  15. @Override
  16. protected void configure(HttpSecurity http) throws Exception {
  17.  
  18. http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
  19. .and()
  20. .authorizeRequests()
  21. .antMatchers("/{idbarrio}/*") //la idea es comparar la url con el rol de manera dinamica.
  22. .hasRole("Barrio_{idbarrio}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement