Commit 507c7d76 authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade nuevas reglas de seguridad

De este modo un invitado solo puede hacer get de una selección en
concreto
parent 25471cb1
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -40,6 +40,14 @@ public class Oauth2SecurityConfiguration {
			
			http.cors();
			
			http.authorizeRequests().antMatchers(HttpMethod.GET, "/**/settings/_suggest").access(
					"#oauth2.hasScope('write') and hasAnyRole('ROLE_ADMINISTRATOR', 'ROLE_OAG', 'ROLE_COLLABORATOR', 'ROLE_USER')");
			
			http.authorizeRequests().antMatchers(HttpMethod.GET, "/**/settings/*").permitAll();
			
			http.authorizeRequests().antMatchers("/**/settings/**").access(
					"#oauth2.hasScope('write') and hasAnyRole('ROLE_ADMINISTRATOR', 'ROLE_OAG', 'ROLE_COLLABORATOR', 'ROLE_USER')");
			
			http.authorizeRequests().antMatchers(HttpMethod.GET, "/actuator/**").permitAll();
			
			http.authorizeRequests().antMatchers(HttpMethod.GET, "/**").permitAll();
@@ -50,8 +58,6 @@ public class Oauth2SecurityConfiguration {
			
			http.authorizeRequests().antMatchers(HttpMethod.POST, "/**/_suggest").permitAll();
			
			http.authorizeRequests().antMatchers("/**/_selection/**").permitAll();
			
			http.authorizeRequests().antMatchers(HttpMethod.GET, "/**/_search/_schema").permitAll();
			
			http.authorizeRequests().antMatchers("/**").access(