Pagination / Search / Deletion
Connecting Mysql to the project (+mysql dependency check pom.xml)
get a json as a response
form validators using Spring Boot Starter Validation
Adding a new patient
Editing a patient
Login in as a user with basic privileges
Login in as an admin with admin privileges
Users and their roles
-i used the first method (commented code) which is the inMemoryAuth and the second method which is jdbc using the same database (mysql patint_db) that we've used before. -i changed controllers path from raw to /admin/example and /user/example to manage roles easily in configure(HttpSecurity http)
we created 3 more tables to authenticate users with jdbc
i filled these tables with
in this part we are moving from jdbc verification to UserDetails
and then, inserting another user for testing nammed "yassirrchi" identified by 1234 as a password with admin/user privileges, to the genrated table app_users that we've seen previously
now lets try our app with UserDetails
"yassirrchi" doesnt have ADMIN's role nor USER, cause there is a difference between roles and authorities in spring-security now lets try fixing this issue by making some changes in SecurityConfig.java
(hasRole to hasAuthority) -lets try once again
why "yassirrchi" is having only USER privileges even though he's an admin? cause our user doesnt respect the conditions that we've set while working with thymeleaf templates
so after changing the condition from hasRole to hasAuthority, lets try again yassirrchi (admin) and anwar (regular user)
finally our app is up and running 🙌