code: function preRemove(next) {
    // jshint validthis: true
    if (auth.roles.isRoot(this.role)) {
      return next(new MongooseError.ValidationError(auth.roles.getMaxRole() + ' role cannot be deleted'));
    }
  
    return next();
  }
docs: Pre remove hook for the User model.
  Validates that the root user cannot be deleted.
  
  @api private
  @param {Function} next - The mongoose middleware callback
  @returns {*} If an error occurs the passed callback with an Error as its argument is called