This commit is contained in:
Kenneth Jao 2016-08-27 18:53:57 -04:00
commit 47119d4161

View File

@ -214,6 +214,17 @@ Meteor.methods({
throw "Unauthorized";
}
},
// For class admins to get code
'getCode': function(classId) {
var foundclass = classes.find({
_id: classId
});
if (foundclass && foundclass.admin == Meteor.userId()) {
return foundclass.code;
} else {
throw "Unauthorized";
}
},
'changeAdmin': function(input) {
var found = Meteor.users.find({
_id: input[0]