Hi there,
I want to show a certain code for a certain group of users. If've found this:
#if ($userAccessor.hasMembership('confluence-administrators', $helper.action.remoteUser.name)
WORKS
#end
It works, but only if I replace the ..remoteUser.. with a real Username. It seems that $helper.action.remoteUser.name does not return any value.
To be sure, I tried this:
$userAccessor.getGroupNamesForUserName($helper.action.remoteUser.name)
$userAccessor.getGroupNamesForUserName('realUsername')
Second works, first not. Does anyone of you have an idea why? I am running Confluence 6.5.2
Thanks,
Franz
It's likely that $helper.action.remoteUser either doesn't exist or returns the string name, therefore if you try to run .name on a string it will return null, as it's not a ConfluenceUser object.
Since you can use a string for this function call, I would recommend using $req.remoteUser instead.
Thanks! I've found out that $action.remoteUser.Name also works!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.