approveClass
This commit is contained in:
parent
df7dd3cc64
commit
a06ed677fe
@ -206,6 +206,21 @@ Meteor.methods({
|
|||||||
throw new Meteor.Error("unauthorized", "You are not authorized to complete this action.");
|
throw new Meteor.Error("unauthorized", "You are not authorized to complete this action.");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'approveClass': function(classId) {
|
||||||
|
if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) {
|
||||||
|
var currentclass = classes.find({
|
||||||
|
_id: classId
|
||||||
|
});
|
||||||
|
currentclass.status = true;
|
||||||
|
Meteor.update({
|
||||||
|
_id: classId
|
||||||
|
}, {
|
||||||
|
$set: {
|
||||||
|
currentclass
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
// For class admins to get code
|
// For class admins to get code
|
||||||
'getCode': function(classId) {
|
'getCode': function(classId) {
|
||||||
var foundclass = classes.findOne({
|
var foundclass = classes.findOne({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user