Merge branch 'master' of https://github.com/ksjdragon/hourglass
This commit is contained in:
commit
47119d4161
@ -214,6 +214,17 @@ Meteor.methods({
|
|||||||
throw "Unauthorized";
|
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) {
|
'changeAdmin': function(input) {
|
||||||
var found = Meteor.users.find({
|
var found = Meteor.users.find({
|
||||||
_id: input[0]
|
_id: input[0]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user