In this recipe, we will show you how to set a default membership for each new created user.
Locate the XML WebUI descriptor for the Organization Service at this path:
<PORTAL_WAR_ROOT>/WEB-INF/conf/organization/organization-configuration.xml
<component-plugin>
<name>new.user.event.listener</name>
<set-method>addListenerPlugin</set-method>
<type>
org.exoplatform.services.organization.impl.NewUserEventListener
</type>
...
membership
in the object NewUserConfig$JoinGroup
and add the required values for the groupId
and the membership
as follows:<object type=
"org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
<field name="groupId">
<string>/platform/users</string></field>
<field name="membership">
<string>member</string></field>
</object>
All the events executed by the creation of the user are captured by the NewUserEventListener
. This is done by an extension of the org.exoplatform.services.organization.UserEventListener
class. In this configuration, the listener receives the new user according to the rules assigned to the NewUserConfig
, in this case groupId
and membership
.
We can modify these attributes and add the name of a special user that doesn't use the default membership type. Here is an example of this specific case:
<field name="ignoreUser"> <string>newadmin</string></field>
3.142.36.231