cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the user's name from a custom dialog?

nicolasraoul
Star Contributor
Star Contributor
Hello all,

I implemented a custom dialog by extending BaseDialogBean as seen on the wiki:
http://wiki.alfresco.com/wiki/Adding_a_Custom_Dialog

In the Java code, I need the id of the current user.

It is probably easy but I could not find where to get this information… I tried a mix of Application.getCurrentUser, this.getActionsContext(), and the methods inherited from BaseDialogBean, but did not find a way to get it… User name or user id or anything that could identify the Alfresco web client user.

Thanks a lot!
2 REPLIES 2

cheffilet
Champ in-the-making
Champ in-the-making
Try this my friend:

AuthenticationUtil.getFullyAuthenticatedUser() and this returns the username

nicolasraoul
Star Contributor
Star Contributor
Thanks my friend!

It gives the name of the current user as a String, such as "admin".
Class is org.alfresco.repo.security.authentication.AuthenticationUtil

That's exactly what I needed 🙂
Thanks again!
Nicolas Raoul