How to use roles in Spring Security without burning them in code?

0

One doubt, I am using Spring boot and Spring Security but if I want to assign roles to my users I have to write the following note in each microservice:

@PreAuthorize("hasAuthority('ADMIN')")

I've also seen it in the WebConfig but it's a bit of the same. Is there no other way to do this without having to handle it in code? a database for example?

    
asked by Carlos Escobar 23.07.2018 в 19:56
source

0 answers