[xwiki-users] Test in a virtual wiki if an user is in a group from main wiki
Hi, I would like to know if is it possible to know if an user is in a group with use of "isUserInGroup" but when I do the test in a virtual wiki and the group is in the main wiki? For example, in the main Wiki, I have the "TestGroup01" with user "Toto" inside, then I would like to test in the virual wiki "WikiTest" So, I tried when the group is the virtual wiki (then it works) with: #if($xwiki.getUser().isUserInGroup('XWiki.testvirtualgroup')) ok #end but I can't do when the group is in the main wiki and dunno if it's possible or not. -- View this message in context: http://xwiki.475771.n2.nabble.com/Test-in-a-virtual-wiki-if-an-user-is-in-a-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, Do you tried this : #if($xwiki.getUser().isUserInGroup('xwiki:XWiki.testvirtualgroup')) "xwiki:" is the prefix of the main wiki Hope this help Maxime 2011/2/8 Pidoux75 <[email protected]>
Hi,
I would like to know if is it possible to know if an user is in a group with use of "isUserInGroup" but when I do the test in a virtual wiki and the group is in the main wiki?
For example, in the main Wiki, I have the "TestGroup01" with user "Toto" inside, then I would like to test in the virual wiki "WikiTest"
So, I tried when the group is the virtual wiki (then it works) with:
#if($xwiki.getUser().isUserInGroup('XWiki.testvirtualgroup')) ok #end
but I can't do when the group is in the main wiki and dunno if it's possible or not. -- View this message in context: http://xwiki.475771.n2.nabble.com/Test-in-a-virtual-wiki-if-an-user-is-in-a-... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi, Yes, I've tried it but doesn't working, result is false. -- View this message in context: http://xwiki.475771.n2.nabble.com/Test-in-a-virtual-wiki-if-an-user-is-in-a-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hello, On Tue, Feb 8, 2011 at 2:52 PM, Pidoux75 <[email protected]> wrote:
Hi,
Yes, I've tried it but doesn't working, result is false.
On a global group (a group on the main wiki), you can only add global users (users from the main wiki). - If the user for which you're testing isUserInGroup(..) is a local user (from the current wiki - virtual in our case), then false is the correct result. - If the user is global (from the main virtual wiki), then this is what is happening: 1) $xwiki.getUser() gets the global user - xwiki:XWiki.GlobalUserName 2) on the main wiki, this user is stored in the global group as being a local (on the main wiki) user - XWiki.GlobalUserName 3) if you try doing $xwiki.getUser('XWiki.GlobalUser') from the virtual wiki, it will search for this user inside the virtual wiki, and most probably there will be no such user - unless you have 2 users with the same username but on different wikis: local and global wiki - and even if there is such a local, the result should be false (I didn't test it) This is why you can't test from a virtual wiki if the current global user is in a global group. You should open a JIRA issue describing this problem (http://jira.xwiki.org) . Raluca.
-- View this message in context: http://xwiki.475771.n2.nabble.com/Test-in-a-virtual-wiki-if-an-user-is-in-a-... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
Le Génie -
Pidoux75 -
Raluca Stavro