If I am understanding this correctly, you just want to retrieve the user object for the user who is currently signed in, yes?
The way that I usually achieve this is by setting up a UserService containing two methods. Then I can implement getLocalUser() throughout the application.
import org.apache.shiro.SecurityUtils
class UserService {
/**
* for currently logged in user
*/
def getLocalUserId(){
def userName = SecurityUtils.subject?.principal
User.findByUsername(userName)
}
User getLocalUser(){
getLocalUserId()
}
}
Hope this helps.