Invitation Application - Join a user to a group

Hi,

Is it possible to invite a user to join the wiki and automatically add him to be a part of a chosen group?

Anyone?

Hi, I don’t know but if it’s not described in https://extensions.xwiki.org/xwiki/bin/view/Extension/Invitation%20Application then it’s probably not there by default. Ofc everything is highly customizable in xwiki so there are always solutions but they may involve scripting or a bit of coding.

Hi @vmassol,

I’ve followed this guide, of course. Seems like it’s not possible out of the box. Can you give me a quick hint where should I start from if I want to try and script my way for this?

I don’t know how the invitation application works but it probably invites the user to register a user himself/herself. What you could do is implement an EventListener, and when a document with a XWikiUsers is created, you could add the user to some groups.

See https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingEventListenerTutorial/

I’d recommend writing it in Java but it’s possible to do it with groovy and Wiki Components.

You could check existing listener code, for example any code in xwiki-platform that extends AbstractEventListener. See https://github.com/xwiki/xwiki-platform/search?q=AbstractEventListener&type=Code

Hope it helps