as a general practice, permissions have been assigned to the corresponding method in the controller layer, for example:
- PreAuthorize
- Secured
- RolesAllowed
however, this way to change the code when adjusting permissions, the most annoying, while writing code, but also thinking about what appropriate permissions should be given.
in this way, it is expected that after the encoder completes the interface, after the program starts, the corresponding role of the URL/ or controller layer method is queried from DB, and then the permissions related to Spring Security are directly called to scan
(such as the initial processing of the above notes), and then the permissions are loaded. You can verify the user role later.
then the question arises: how to find initialization methods for PreAuthorize
, Secured
, RolesAllowed
annotations, and do these methods provide public interfaces for programs to call?
I would appreciate it if someone could give me some advice.