code: function set(Account, roles) {
  
      var Role = app.models.Role;
      for (var name in roles) {
        var role = roles[name];
        var model = app.models[role.model];
        model.belongsTo(Account, {
          foreignKey: 'accountId',
          as: 'account'
        });
  
        model.validatesUniquenessOf('accountId');
  
        Account.hasOne(model, {
          foreignKey: 'accountId',
          as: name
        });
  
        Role.registerResolver(name, function(roleName, context, cb) {
  
          Promise.resolve()
            .then(function() {
  
              var result = context.accessToken && context.accessToken.roles && context.accessToken.roles[roleName];
              return result?true:false;
  
            })
            .asCallback(cb);
  
        });
  
      }
  
    }
docs: console.log(roles);