@Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.csrf().disable() .authorizeHttpRequests((authorize) -> authorize.requestMatchers("/register/**").permitAll() .requestMatchers("/").permitAll() .requestMatchers("/users").hasRole("ADMIN") .requestMatchers(HttpMethod.DELETE,"/users/delete/**").hasRole("ADMIN") It gives me Error 403 when I include Spring Security although i login as admin, can you help me?
Thanks bro for this whole springboot videos..👌💖
it enabled me to solve my problem, thank you very much !
thanks for the series very helpful
When we deleted the record and then add another record the I'd is not the next number of present record it is next of deleted record .
What happen in case you want delete the data which is not present, can you please tell how you can handel those case
You can check if the requested record exists in db, and then add an if condition if the record exists else return 404
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeHttpRequests((authorize) ->
authorize.requestMatchers("/register/**").permitAll()
.requestMatchers("/").permitAll()
.requestMatchers("/users").hasRole("ADMIN")
.requestMatchers(HttpMethod.DELETE,"/users/delete/**").hasRole("ADMIN")
It gives me Error 403 when I include Spring Security although i login as admin, can you help me?