diff options
-rw-r--r-- | models/Access.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/models/Access.js b/models/Access.js index 3c29a36..bde5b4a 100644 --- a/models/Access.js +++ b/models/Access.js @@ -6,6 +6,18 @@ var mongoose = require('mongoose') , Schema = mongoose.Schema; + +/** + * Schema + * + * Permissions: + * 3 = normal + * 6 = admin + * 9 = owner + * These permissions are set in steps of three, in case + * we need to add more permissions later. + */ + var AccessSchema = new Schema({ user: { type: Schema.ObjectId, ref: 'User' }, creator: { type: Schema.ObjectId, ref: 'User' }, @@ -15,6 +27,7 @@ var AccessSchema = new Schema({ updated: { type: Date, default: Date.now } }); + // the four validations below only apply if you are signing up traditionally AccessSchema.statics = { |