2.14. Predefined users, groups and memberships

When eXo Platform starts for the first time, it initializes some users, groups and memberships, such as user root and group /platform. Some user attributes are set also, including password, firstname, lastname and email.

First you should get familiar with the expression of group and membership. If a user has the member:/platform/users membership, it means the user is a member of the /platform/users group. The groups are organized like a tree, in which /platform/users is a sub-group of /platform group.

A membership is formed by a membership type and a group. Member, editor and manager are some of predefined membership types. So strictly speaking, "membership type" and "membership" are different concepts. However, the word "membership" is sometimes used with the meaning of "membership type".

Next you will learn the configurations of predefined users, groups and memberships which are written in platform-extension.war!/WEB-INF/conf/organization/organization-configuration.xml. This section does not directly aim at changing those predefined organizational data, but if it is the further step you want to go, you can easily perform via the extension mechanism provided by eXo Platform.

Organizational data initializer

At top of the configuration file, you see the initializer declaration that is supposed to create all the predefined data discussed here:


<component-plugin>
    <name>init.service.listener</name>
    <set-method>addListenerPlugin</set-method>
    <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
    <description>this listener populate organization data for the first launch</description>
    <init-params>
        <value-param>
            <name>checkDatabaseAlgorithm</name>
            <description>check database</description>
            <value>entry</value>
        </value-param>
        ...
    </init-params>
</component-plugin>

Notice the value of checkDatabaseAlgorithm. If it is set to entry, each user, group and membership listed in the configuration is checked each time eXo Platform is started. If an entry does not exist in the database yet, it will be created. If the value is set to empty, the data will be updated to the database only if the database is empty.

Predefined membership types

All predefined membership types can be found under the membershipType field. Here is an extract:


<field name="membershipType">
    <collection type="java.util.ArrayList">
        <value>
            <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
                <field name="type"><string>*</string></field>
                <field name="description"><string>Any membership type</string>  </field>
            </object>
        </value>
        <value>
            <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
                <field name="type"><string>manager</string></field>
                <field name="description"><string>manager membership type</string></field>
            </object>
        </value>
        ...
    </collection>
</field>

Predefined groups

All predefined groups can be found under the group field. Here is an extract:


<field name="group">
    <collection type="java.util.ArrayList">
        <value>
            <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
                <field name="name"><string>developers</string></field>
                <field name="parentId"><string /></field>
                <field name="description"><string>the /developers group</string></field>
                <field name="label"><string>Development</string></field>
            </object>
        </value>
        ...
    </collection>
</field>

Predefined users

All predefined users can be found under the user field. The configurations are username, firstname, lastname, email, password and the list of memberships granted to the user. Here is an extract:


<field name="user">
    <collection type="java.util.ArrayList">
        <value>
            <object type="org.exoplatform.services.organization.OrganizationConfig$User">
                <field name="userName"><string>${exo.super.user}</string></field>
                <field name="password"><string>gtn</string></field>
                <field name="firstName"><string>Root</string></field>
                <field name="lastName"><string>Root</string></field>
                <field name="email"><string>root@localhost</string></field>
                <field name="groups">
                    <string>*:/platform/administrators,*:/platform/users,*:/platform/web-contributors,*:/organization/employees,member:/organization/management/executive-board</string>
                </field>
            </object>
        </value>
        ...
    </collection>
</field>

Note that the code above uses the exo.super.user property which is set to root in the file:

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus