From a06ed677fe2da3c1df29b071226a351a64c6af77 Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Sun, 23 Oct 2016 21:42:18 -0400 Subject: [PATCH] approveClass --- hourglass/server/main.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 8102297..334480f 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -206,6 +206,21 @@ Meteor.methods({ 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 'getCode': function(classId) { var foundclass = classes.findOne({