docs: function() {
    var self = this;
  
    // Add libraries
    this.jwt = jwt;
  
    // secret
    this.secret = molecuel.config.user.secret;
  
    //  define default roles
    var roles = ['admin','editor'];
    // check if there are roles defined by the configuration of the current project
    if(molecuel.config && molecuel.config.user && molecuel.config.user.roles) {
      roles = molecuel.config.user.roles;
    }
  
    if(_.indexOf(roles, 'authenticated') === -1) {
      roles.push('authenticated');
    }
  
    this.passport = passport;
  
    // Definition of the user schema
    this.userSchema =  {
      // Definition of the username
      username: { type: String, list: true, required: true, trim: true, unique: true, index: true },
      // Define the email address
      email: { type: String, list: true, trim: true, lowercase: true, required: false},
      // save the date and time of the last login
      lastlogin: { type: Date, 'default': Date.now, form: {readonly: true}},
      // save date and time of the last logon error
      lasterror: { type: Date, form: {readonly: true}},
      // save the creation date of the user
      creation: { type: Date, 'default': Date.now, form: {readonly: true}},
      // count the visits of the user
      visits: {type: Number, 'default': 0, form: {readonly: true}},
  
      // Password
      // these two fields are fake fields only and will be deleted
      password: {type: String},
      passwordConfirmation: {type: String, form:{ secure: true}},
  
      // password save
      salt: { type: String, required: false, form: {hidden:true }},
      hash: { type: String, required: false, form: {hidden: true}},
  
      name: {
        first: { type: String, required: false, trim: true },
        last: { type: String, required: false, trim: true }
      },
      authtype: {type: String, 'default': 'local'},
      active: { type: Boolean, 'default': true, index: true},
      roles: [{
        type: String,
        enum: roles,
        required: false,
        form:{
          formStyle: 'inline',
          placeHolder: 'Select roles'
        }
      }]
    };
  
    molecuel.once('mlcl::elements::registrations:pre', function(module) {
      elements = module;
      // module == elements module
      var schemaDefinition = {
        schemaName: 'user',
        schema: self.userSchema,
        options: {indexable: false, avoidTranslate: true, avoidUrl: true}
      };
      elements.registerSchemaDefinition(schemaDefinition);
    });
  
    // on elements registration of user schema
    molecuel.on('mlcl::elements::registerSchema:post::user', function(module, schemaRegistryEntry) {
      self.schema = schemaRegistryEntry.schema;
      //module.addToBaseSchema({createdby: {type: elements.ObjectId, ref: 'user', form:{hidden:true}}});
      self.schema.plugin(self._registerDefaultschemaFunctions);
    });
  
    // schema registration event
    molecuel.on('mlcl::elements::registerSchema:post', function(module, schemaname, schemaRegistryEntry) {
      schemaRegistryEntry.schema.plugin(self._defaultSchemaPlugin);
    });
  
  
    molecuel.on('mlcl::elements::setElementType:post::user', function(module, model) {
      self.model = model;
      self._registerDefaultPassportFunctions(model);
      molecuel.emit('mlcl::user::init:post', self);
    });
  
    molecuel.once('mlcl::elements::init:post', function(elements) {
      elements.registerPostApiHandler(self._postApiHandler);
    });
    return this;
  }