Documentation of xwiki.getuser?

First of all, apologies in advance if I’m asking the obvious. I’ve just started using xwiki.

I’m looking for a the documentation of the getuser function used in a velocity macro.
Specifically, I want to use it to query parameters of the user profile (e. g. company, position, type).

I managed to query the group using:
{{velocity}}
#if($xwiki.getUser().isUserInGroup(‘XWiki.InternalOnly’))
Displayed only if user is in InternalOnly group!
#end
{{/velocity}}

But I did not find how to query other parameters.

Thank you for your help!

Hi @werber!
Indeed there are not many properties exposed by the User API. Instead you can use the concept of XWiki document with XWikiUser object attached.
First you need to resolve the user as a document:
#set ($userDoc = $xwiki.getDocument('XWiki.username')
Then you need to get the user object form the user document:
#set ($userObj = $userDoc.getObject('XWiki.XWikiUsers'))
In the end you can access all the properties with:
$userObj.getValue('propertyName').

Hope it helps,
Alex

Thank you Alex! I will try this approach.

Kind regards,
Waltraud