Extended Group API
Last modified by Admin on 2021/03/17 21:21
![]() | List of groups and subgroups that the current user or group is member of |
Type | JAR |
Category | |
Developed by | |
Active Installs | 10 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
List of groups and subgroups that the current user or group is member of
Simple usage example
{{velocity}}
## get reference to a user
#set($userRef = $xwiki.getDocument("xwiki:XWiki.Admin").getDocumentReference())
Groups of user $userRef:
## list all groups (return values are strings, actually)
#foreach($groupName in $services.userGroup.getGroups($userRef, true, true, true))
* $groupName
#end
{{/velocity}}
## get reference to a user
#set($userRef = $xwiki.getDocument("xwiki:XWiki.Admin").getDocumentReference())
Groups of user $userRef:
## list all groups (return values are strings, actually)
#foreach($groupName in $services.userGroup.getGroups($userRef, true, true, true))
* $groupName
#end
{{/velocity}}
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.
Dependencies
Dependencies for this extension (org.xwiki.contrib.usergroup:api-usergroup 1.0):
- org.xwiki.commons:xwiki-commons-component-api 5.2.2
- org.xwiki.commons:xwiki-commons-script 5.2.2
- org.xwiki.platform:xwiki-platform-oldcore 5.2.2
- org.xwiki.platform:xwiki-platform-model 5.2.2