loopback/lib/models/role.js

18 lines
602 B
JavaScript
Raw Normal View History

// Role model
var RoleSchema = {
2013-07-09 22:06:42 +00:00
id: {type: String, required: true}, // Id
2013-07-08 23:59:11 +00:00
name: {type: String, required: true}, // The name of a role
2013-07-09 22:06:42 +00:00
description: String, // Description
roles: [String], // A role can be an aggregate of other roles
2013-07-09 22:06:42 +00:00
users: [String], // A role contains a list of user ids
// Timestamps
created: {type: Date, default: Date},
modified: {type: Date, default: Date}
}
module.exports = function(dataSource) {
2013-07-16 18:52:21 +00:00
dataSource = dataSource || new require('loopback-data').ModelBuilder();
2013-07-09 22:06:42 +00:00
var Role = dataSource.define('Role', RoleSchema);
return Role;
}