Hi,

hudson.model.user.getById(String id, false).getFullName() would be the best 
approach.
It uses direct access to user profiles inside Jenkins. 
https://javadoc.jenkins-ci.org/hudson/model/User.html

Best regards,
Oleg

On Tuesday, July 14, 2020 at 2:21:12 PM UTC+2, Tidhar Klein Orbach wrote:
>
> Hi
>
> I looked on https://issues.jenkins-ci.org/browse/JENKINS-48900 and the 
> relevant code in role strategy plugin.
>
> I have found that RoleMap 
> <https://github.com/jenkinsci/role-strategy-plugin/blob/master/src/main/java/com/michelin/cio/hudson/plugins/rolestrategy/RoleMap.java#L90>
>  
> uses org.acegisecurity.userdetails.UserDetails to get the user details.
> I see that UserDetails interface has getUserName() which is used for the 
> "sid" in the role-strategy-plugin. But there is no getDisaplyName  in the 
> interface.
> It does exist  in some of its implemented classes (for example 
> ActiveDirectoryUserDetail)
>
> any suggestions how to get the full name if exists?
>
> thanks,
> Tidhar
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/96aeb71a-c61a-4d8c-b977-d0c11e601634o%40googlegroups.com.

Reply via email to