Commit 3ec824d8 authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade reglas de oauth para acceso a settings

parent 4b5dcf61
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -44,6 +44,14 @@ public class Oauth2SecurityConfiguration {
			http.authorizeRequests()
				.antMatchers(HttpMethod.POST, "/discover-layers/**").permitAll();
			
			http.authorizeRequests().antMatchers(HttpMethod.DELETE, "/**/settings/**").access(
					"#oauth2.hasScope('write') and hasAnyRole('ROLE_ADMINISTRATOR', 'ROLE_OAG', 'ROLE_COLLABORATOR', 'ROLE_USER')");
			
			http.authorizeRequests().antMatchers(HttpMethod.GET, "/**/settings/**").permitAll();
			http.authorizeRequests().antMatchers(HttpMethod.POST, "/**/settings/**").permitAll();
			http.authorizeRequests().antMatchers(HttpMethod.PUT, "/**/settings/**").permitAll();
			http.authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/**/settings/**").permitAll();
			
			http.authorizeRequests().antMatchers(HttpMethod.POST, "/**").access(
					"#oauth2.hasScope('write') and "
					+ "hasAnyRole('ROLE_ADMINISTRATOR', 'ROLE_OAG', 'ROLE_COLLABORATOR')");