I’ve got a domain-class with a user reference:
class MyThing {
MyUser createdBy
//...
And with using the Spring Security plugin, I have a fairly basic Person class setup except I’m trying to obtain the user’s email address from reference. Using springSecurityService.principal works great but only for the currently logged in user.
How can I get the user’s email address?
If I can’t simply “lookup” by username reference, then is it possible to extend my Person class to acquire email address from the LDAP plugin and save to the database?
I solved my problem by first adding an email property to my Person class.
Then by using a ldap template attributes map, I was able to pull the email as well as the username.
From there it was just getting the property
createdBy.email