Re: [xwiki-users] Test in a virtual wiki if an user is in a group from main wiki

2011-02-09 Thread Raluca Stavro
Hello,

On Tue, Feb 8, 2011 at 2:52 PM, Pidoux75 pidou...@gmail.com 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-group-from-main-wiki-tp6003586p6003835.html
 Sent from the XWiki- Users mailing list archive at Nabble.com.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Test in a virtual wiki if an user is in a group from main wiki

2011-02-08 Thread Pidoux75

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-group-from-main-wiki-tp6003586p6003586.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Test in a virtual wiki if an user is in a group from main wiki

2011-02-08 Thread Le GĂ©nie
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 pidou...@gmail.com


 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-group-from-main-wiki-tp6003586p6003586.html
 Sent from the XWiki- Users mailing list archive at Nabble.com.
 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Test in a virtual wiki if an user is in a group from main wiki

2011-02-08 Thread Pidoux75

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-group-from-main-wiki-tp6003586p6003835.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users