fix #58 with function getCode(classId)
This commit is contained in:
parent
96e413f005
commit
aed412af10
@ -214,6 +214,15 @@ 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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user