Group REST Server

Last modified by Admin on 2022/04/18 00:09

cogExpose a REST API to access various groups informations
TypeJAR
Category
Developed by

Thomas Mortagne

Active Installs0
Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

Require XWiki 11.10+

Installable with the Extension Manager

Description

This extension expose a REST API to access various group related information.

List the groups of a member

https://myhost/xwiki/rest/grouprest/groups/{member}?recursive=true

  • {member}: the id of the member
  • recursive: false (the default) if only the direct groups should be returned, true to take into account groups of groups

The result provide the following:

  • input: the member id provided in input
  • reference: the resolved member complete reference
  • groups: the list of found groups (listed with they complete reference)

It's possible to customize how the member reference is resolving in xwiki.properties file:

#-# The reference of the class of the object which contains the property to compare with the input member id.
#-#
#-# The default is:
# grouprest.user.mapping.class=XWiki.XWikiUsers

#-# The name of the property which which to compare input value.
#-#
#-# For example if you want to pass the first name of a user in the REST URL:
# grouprest.user.mapping.property=first_name

Both XML (default) and JSON are supported as results (controlled by the HTTP accept).

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<memberGroups xmlns="http://www.xwiki.org/grouprest">
   <input>
        Administrator
   </input>
   <reference>
        xwiki:XWiki.Admin
   </reference>
   <goups>
        xwiki:XWiki.XWikiAllGroup
   </goups>
</memberGroups>
{
 "input": "Administrator",
 "reference": "xwiki:XWiki.Admin",
 "goups": [
   "xwiki:XWiki.XWikiAllGroup"
  ]
}

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.

Release Notes

v1.1.1

v1.1

v1.0

Dependencies

Dependencies for this extension (org.xwiki.contrib.grouprest:grouprest-server 1.1.1):

Get Connected