we-plugin-user
Version:
We.js user resource and routes
28 lines (27 loc) • 579 B
JavaScript
/**
* userPrivacity model
*
* @module :: Model
* @description :: Controlls the user data visibility
*
*/
module.exports = function (we) {
return {
definition: {
field: {
type: we.db.Sequelize.STRING,
allowNull: false
},
// public or private
privacity: {
type: we.db.Sequelize.STRING,
defaultValue: 'public'
},
// privacity record for send in json response
record: { type: we.db.Sequelize.VIRTUAL }
},
associations: {
user: { type: 'belongsTo', model: 'user' }
}
};
};