In Javascript, is there any way to determine if the current user ( AJS.params.remoteUser ) is a member of the group 'confluence-administrators' ?
Thanks !
Community moderators have prevented the ability to post new answers.
Hello Dean,
On Javascript exactly I don't know, but I know on Velocity Script, should at least give you a good guidance :) I hope.
To pickup a list of groups from the Current User looking the page use this:
#set ($groups = $userAccessor.getGroupNames($action.remoteUser))
and to see if it is from confluence-administrators:
#if ($groups.contains("confluence-administrators"))
Hope this helps you!
Cheers,
Guilherme
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, this information is not present in the client unless specifically requested. Additionally, retrieving group membership information requires administrative permissions, so you can't simply make an AJAX call in the current user's HTTP session.
You'd need to do this on the server, by writing a plugin and then exposing this information over REST, XML-RPC or something similar - however, keep in mind that vanilla Confluence treats group memberships as sensitive information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Joe ! Your comment makes perfect sense. Luckily the above workaround meets my needs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joe,
I was hoping that you might be able to help me. My user community wants to disable the presentation of the Space and People tabs and I have found that I can do that for anonymous users or for a specific user as described here:
I have tested it successfully with a specific user id or by using empty quotes:
if (AJS.params.remoteUser == 'testuser' )
What I am trying to do however is to disable for ALL logged in users but trying "*" as a wildcard didn't work. Is there a way to do this that you know of?
Thank you
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.