createClass backbone
This commit is contained in:
parent
cf7a586cf2
commit
701c964083
@ -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},
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user