Initial Commit

This commit is contained in:
root
2013-05-06 03:38:29 -04:00
commit d392a540e7
134 changed files with 22012 additions and 0 deletions

24
app/model/user.js Normal file
View File

@ -0,0 +1,24 @@
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var userSchema = new Schema({
name: {
first: String,
last: String
},
email: String,
picture: String,
refreshToken: String,
accessToken: String,
groups: [String],
perms: [String],
deleted: { type: Boolean, default: false }
});
userSchema.methods.hasPermission = function(perm) {
return this.perms.indexOf(perm) != -1;
}
var User = module.exports = mongoose.model('User', userSchema);