From 7e0295bc53c8528752e57967f73b2ed24d8fdf27 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Tue, 14 May 2013 09:55:10 +0200 Subject: added access priveliges in comments, so we know what they mean --- models/Access.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'models/Access.js') 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 = { -- cgit v1.2.3