Thanks Thomas, for your reply.
I was looking at the API and it has lots of methods we could use. But, I am
not able to use them ..:(

#set($rightsAPI=$xwiki.get("RightsManagerPluginApi"))
#set($num=$rightsAPI.countAllMembersNamesForGroup("XWiki.ROCKPMGroup"))
or
#set($cxt=$rightsAPI.getXWikiContext())
#set($num=$cxt.countAllMembersNamesForGroup("XWiki.ROCKPMGroup"))
or
#set($num=$xwiki.countAllMembersNamesForGroup("XWiki.ROCKPMGroup"))
number $num

I tried the above and it does not work. Can you please tell me what is wrong
in the way I am tyring to use the API

Thanks a lot


On 4/24/08, Kamna Jain <[EMAIL PROTECTED]> wrote:
>
> Hello Devs,
>
> In our project we need to eb able to assign different rights to different
> users but, we do not want to give access to the Administration Page to
> everybody.
> So, I create a page where I would fill in a drop down box wit user names
> and group name and then write a script to add the selected user tothe
> selected group.
>
> For this, I did the following but, this added objects of
> XWiki.XWikiGroup(one for each of the users) to this page and now this page
> shows up in my Admin space with the other groups. Is there a method to just
> get a list of all user names in the XWiki, that I can use instead of using
> this complex query. or Is there a better way to do this.
>
> Also, once I select a user and a group, how do I add the user to the group.
> Is there a method/script for that? I see a "adduorg.vm" in the templates.
> What is the purpose of this script? where is it called? What is "uorg"?
>
>
> Use this Form to Assign New Roles or modify Existing Roles for the members
> of ROCK!
>
> <html>
> <form>
> Select User:
> <select name="currentusers">
> #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and
> obj.className='XWiki.XWikiUsers'")
> #foreach ($item in $xwiki.searchDocuments($sql))
>  #set($userdoc=$xwiki.getDocument($item))
>  #set($userobj=$userdoc.getObject("XWiki.XWikiUsers"))
>  #set($username=$userobj.getName())
>  <option value="$username">$username</option>
> #end
> </select>
>
> Select Role:
> <select name="rockroles">
> #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and
> obj.className='XWiki.XWikiGroups' and obj.name
> <>'XWiki.XWikiGroupTemplate'")
> #foreach ($item in $xwiki.searchDocuments($sql))
>  <option value="$item">$item</option>
> #end
>
>  </select>
> </form>
> </html>
>
>
>
> Please help!
>
> Thanks
>
>
>
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to