mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Initial Commit
This commit is contained in:
24
app/model/user.js
Normal file
24
app/model/user.js
Normal 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);
|
Reference in New Issue
Block a user