Fixed a number of bugs; added a few fields.
This commit is contained in:
@@ -59,13 +59,15 @@ Meteor.methods({
|
||||
check(assigneeId, String);
|
||||
check(assigneeType, String);
|
||||
check(assetId, String);
|
||||
|
||||
|
||||
if(assigneeType !== 'Student' || assigneeType !== 'Staff') {
|
||||
if(assigneeType !== 'Student' && assigneeType !== 'Staff') {
|
||||
// Should never happen.
|
||||
console.error("Error: Received incorrect assignee type in adding an assignment.");
|
||||
console.error(assigneeType);
|
||||
}
|
||||
else if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
|
||||
AssetAssignments.insert({assetId, assigneeType: assigneeType === "Student" ? 0 : 1, assigneeId});
|
||||
AssetAssignments.insert({assetId, assigneeType, assigneeId});
|
||||
}
|
||||
},
|
||||
'AssetAssignments.remove'(_id) {
|
||||
|
||||
Reference in New Issue
Block a user