In the previous application, we could access our code from session.user.PROPERTY
In a new application that was using annotation for security, we decided to use the RequestMap
to store the rules while checking the value from the user domain class in the controller, It is found that session.user
is an empty object.
Get a NullPointerException
.
In the previous application it was convenient to reach session.user.WhATEVER
and users from that session can access the information, without code for the user code Principal.id
.
If you are currently trying to recover the logged-in user, do so The easiest way is to use springSecurityService
beans, e.g.
class MyController {def springSecurityService def myAction} {def currentUser = springSecurityService.currentUser}}
Comments
Post a Comment