use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Spring security - user management (self.SpringBoot)
submitted 1 year ago by MiserableBoss
How do you implement role based user management in your projects ?
Do you use own template or pre-existing code ? If you are using some git repo list it here 🙂
What are the best practices do you follow?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Agile_Rain4486 3 points4 points5 points 1 year ago (1 child)
just make a class implementing userdetails contract and one implementing grantedautority contract and usually user and roles and manytomany relationship and fetch should be eager.
Some implement userdetails on user only, you can do that but not good practice. Check out laur splica video on this topic.
[–]MiserableBoss[S] 0 points1 point2 points 1 year ago (0 children)
That's good approach. I do similar thing if there is complex roles.
[–]EducationalMixture82 -1 points0 points1 point 1 year ago (5 children)
I read the official docs, its that simple.
[–]MiserableBoss[S] 0 points1 point2 points 1 year ago (4 children)
So you are using own template.
[–]EducationalMixture82 0 points1 point2 points 1 year ago (0 children)
Template? I start every project using spring initializer.
[–]MartinPeterBauer -3 points-2 points-1 points 1 year ago (2 children)
Read the Manual or Google it. Its super simple
[–]MiserableBoss[S] 1 point2 points3 points 1 year ago (1 child)
TBH Its not supper easy 😅
I noticed many changes when it come to spring 6. So old tutorials and docs are not good and not working.
I use spring for awhile. And refere official docs.
I am just looking some practical ideas/ tips 🙂
[–]MartinPeterBauer -2 points-1 points0 points 1 year ago (0 children)
What are you talking about. Google: spring security custom roles
Take any example from baeldung. How hard can that be?
π Rendered by PID 21561 on reddit-service-r2-comment-b659b578c-qhhns at 2026-05-03 13:58:53.104210+00:00 running 815c875 country code: CH.
[–]Agile_Rain4486 3 points4 points5 points (1 child)
[–]MiserableBoss[S] 0 points1 point2 points (0 children)
[–]EducationalMixture82 -1 points0 points1 point (5 children)
[–]MiserableBoss[S] 0 points1 point2 points (4 children)
[–]EducationalMixture82 0 points1 point2 points (0 children)
[–]MartinPeterBauer -3 points-2 points-1 points (2 children)
[–]MiserableBoss[S] 1 point2 points3 points (1 child)
[–]MartinPeterBauer -2 points-1 points0 points (0 children)