From 701c964083374de4bfad29ca33ac754c78077476 Mon Sep 17 00:00:00 2001 From: yamanq Date: Mon, 8 Aug 2016 21:05:25 -0400 Subject: [PATCH] createClass backbone --- hourglass/collections/main.js | 2 +- hourglass/server/main.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hourglass/collections/main.js b/hourglass/collections/main.js index 5ae871a..000472c 100644 --- a/hourglass/collections/main.js +++ b/hourglass/collections/main.js @@ -16,7 +16,7 @@ classes.schema = new SimpleSchema({ admin: {type: String, optional: true}, status: {type: Boolean, defaultValue: false}, code: {type: String, defaultValue: ""}, - privacy: {type: String}, + privacy: {type: Boolean}, category: {type: String}, moderators: {type: [String], optional: true}, banned: {type: [String], optional: true}, diff --git a/hourglass/server/main.js b/hourglass/server/main.js index c70b351..107dbcf 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -10,13 +10,16 @@ Meteor.methods({ 'genCode': function() { return 'xxxxxx'.replace(/[x]/g, _uuid4); }, - //NOT COMPLETE V + //No Security 'createClass': function(input) { - if(Meteor.user() != null && Meteor.classes.find({status:true, admin:Meteor.userId()}).length < 5 && - schools.find({name:input.school}).fetch().length > 0){ - classes.schema.validate(input); + // if(Meteor.user() != null && classes.find({status:true, admin:Meteor.userId()}).length < 5 && + // schools.find({name:input.school}).fetch().length > 0){ + // classes.schema.validate(input); classes.insert(input); - } + // return 1; + // } else { + // return 0; + // } }, 'editProfile': function(change) { current = Meteor.user().profile;