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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.