Thanks a lot for the content,! For the first time I’m actually able to grasp the content and not just code blindly ! Great explaining and amazing content ! Very helpful
Hi. I don't know if you're still reading comments under this series but I've got a question You see, I've been working on app that has 2 types of users - employees and clients - that are stored in seperate tables, therefore they are seperate entities and use seperate models. For employees, I was planning to have 2 roles - a normal EMPLOYEE and ADMIN, while every client has a CLIENT role. I don't think it makes much sense to make a triple-join table between employees, clients and roles, so I wanted to ask if there's a way to automatically assign the role CLIENT to any user stored in the clients table, or should I just give in and make a join table with a role column, client column and employee column?
Hello, this is a really great tutorial! I was wondering if the roles could be an actual field in the User Entity or if is it always better to create a table for the roles
Hi Man, great tutorial! I was wondering cuz my teacher said that i can't use fetchType.EAGER in this Set roles but without that, i can't even authorize user in postman with 401 unauthorized, because i think roles for this user are not load. Do you have idea how to replace this EAGER fetch to something different?
I was struggling to connect my react to spring boot back-end with security, i wish you could make a video about it. i will also try to use the knowledge i gathered here to work it out.
Why is it many to many? Is this because you're saying someone can have more than one role? The admin would have user and admin? Why not just do one to many role. where one user can only have one role. user can have user role. admin can have only admin role.
Many-many is better for infinite combinations of roles. In .NET, roles are one-to-many so you could do it that way, but I don’t think you could have infinite combinations like a many to many since it can only tied to one entity. Also, all I saw in Java security roles were all many to many, so seemed like better choice.
Authentication: Who are you?
Authorization: What can you do?
Thanks a lot for the content,! For the first time I’m actually able to grasp the content and not just code blindly ! Great explaining and amazing content ! Very helpful
You are the best!!! How did you manage to explain this complex topic in such a way that even a 5-year-old would understand. Amazing!!!
Thank you so much for the lesson, Teddy.
Bro that's coolest video i've ever seen, i've understood everything even if i'm not nature english speaker. You god of a teaching broooooooo!!!!!!!!
Hi. I don't know if you're still reading comments under this series but I've got a question
You see, I've been working on app that has 2 types of users - employees and clients - that are stored in seperate tables, therefore they are seperate entities and use seperate models. For employees, I was planning to have 2 roles - a normal EMPLOYEE and ADMIN, while every client has a CLIENT role. I don't think it makes much sense to make a triple-join table between employees, clients and roles, so I wanted to ask if there's a way to automatically assign the role CLIENT to any user stored in the clients table, or should I just give in and make a join table with a role column, client column and employee column?
Thank you sir
did you linked to database already or something to be able to see it in database view layer? cause i don't know if you did that part or just skipped ?
this playlist is awesome, I wish you made these tutorials using jdk17 or newer version
I’m prob going to remake this course so be sure to check back later
Hello, this is a really great tutorial! I was wondering if the roles could be an actual field in the User Entity or if is it always better to create a table for the roles
better to create separate talbe
Users can have multiple roles, so a separate table is nice
Database ?? I am guessing that there was some postgres configuration in the previous series.
But if role has many like it should be string like if user save roles means how to do
Hi, is it better to use enum than class for roles?
Hi Man, great tutorial! I was wondering cuz my teacher said that i can't use fetchType.EAGER in this Set roles but without that, i can't even authorize user in postman with 401 unauthorized, because i think roles for this user are not load. Do you have idea how to replace this EAGER fetch to something different?
You do LAZY and when you need the roles you getRoles() and it will be EAGER when function executes.
To get a better learning experience, do a 1.25x speed.
I do it at 2x
I was struggling to connect my react to spring boot back-end with security, i wish you could make a video about it. i will also try to use the knowledge i gathered here to work it out.
Gonna take a while but react + spring is def on my list
let's say that i've been creating two user with the same role (admin), is it correct to have duplicated role in the 'role' table ?
Yes that is major reason for having many to many
Can I make some alternative in no SQL database?
I wish there was one for a MongoDb database
Can we use ENUM for the User's roles instead of creating new classes and tables, wouldn't it be easier or it won't work with the ENUM?
Sure Enum would actually be better idea
great, thanks!@@TeddySmithDev
@3:05 You got down with that comment on the "weird thing a friend has going on" in his basement. What could it be? 🤨
Some type of grow operation or a clandestine chemistry lab lmaoooo
Why is it many to many? Is this because you're saying someone can have more than one role? The admin would have user and admin? Why not just do one to many role. where one user can only have one role. user can have user role. admin can have only admin role.
Many-many is better for infinite combinations of roles. In .NET, roles are one-to-many so you could do it that way, but I don’t think you could have infinite combinations like a many to many since it can only tied to one entity. Also, all I saw in Java security roles were all many to many, so seemed like better choice.
@@TeddySmithDev Thank you for answering my question! I've been looking all over as to why this would be the case.
@joincolumn i am getting errors
cannot be a resolved type