Caleb and the XWiki community,

Thanks for the response! I wasn't actually aware that this method could take 
groups as parameters, but if you're right, then it really might solve our 
problem! However, given the number of groups that we have on xwiki, it may 
prove a little tedious. Are there any methods that perform these functions:

xwiki.getGroupsWhoHaveAccessToAGivenPage("view,edit, etc",$docname)

or a context method:

context.getGroupsWhoHaveAccessToThisPage("view, edit, etc")

that would allow us to get a list of users back? I haven't heard of a method in 
xwiki that actually returns an array or list, so I may just be hoping for too 
much, but if anyone can think of a way to implement this, then it would be 
fabulous.

Thanks!

Felix



----- Original Message ----
From: Caleb James DeLisle <calebdeli...@lavabit.com>
To: XWiki Users <users@xwiki.org>
Sent: Wed, February 17, 2010 1:58:21 AM
Subject: Re: [xwiki-users] Method that returns list of groups for a page

Hello Felix,

I think you're looking for:
$xwiki.hasAccessLevel("edit", "XWiki.SomeUser", "Main.DocumentInQuestion"))

see: 
http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/api/XWiki.html#hasAccessLevel(java.lang.String,%20java.lang.String,%20java.lang.String)

It says users, but I think you can use a group name instead.

Caleb


Meng Wu wrote:
> Hey all,
> 
> I am trying to find a method that can return a list of groups that have a 
> given access right to a given page. Is there a method(s) that allow me to do 
> that? I'm aware that you can create an object of AccessRights onto a given 
> page and filter in groups and users that have access rights to a given page, 
> but only admins can see that. I need to generate a list of groups that have 
> granted access so that when an unregistered user tries to log onto a page 
> that he doesn't have access to, a list will be generated so that he can ask 
> for membership to those groups. 
> 
> Thank you,
> 
> Felix Wu
> 
> 
> 
>      
> 
> _______________________________________________
> 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



      

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

Reply via email to