On Thu, Apr 24, 2008 at 7:16 PM, Kamna Jain <kammy.scorpi(a)gmail.com> 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.
Look at rightsmanager plugin api :
http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/index.html
It contains lots of methods to retrieve users and group with filters,
limit, sort...
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"?
There is not api to add user in groups.
I think "uorg" means "user or group" and is used by ajax based
users/groups admin interface. You can look at this file for a example
of how to add a user in a group or maybe even use it directly.
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
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne