LT-117: Remove the user from reviewers when session timeout
This commit is contained in:
1 parent
8ee2eaf644
commit
feb7f0972c
3 files changed
+13
-2
No files matched your search
@@ -1,5 +1,8 @@
|
||||
Meteor.methods({
|
||||
setReviewer: function (studyInstanceUid) {
|
||||
if (!studyInstanceUid) {
|
||||
return;
|
||||
}
|
||||
var study = Studies.findOne({
|
||||
studyInstanceUid: studyInstanceUid
|
||||
});
|
||||
@@ -45,6 +48,9 @@ Meteor.methods({
|
||||
},
|
||||
|
||||
removeReviewer: function (timepointId) {
|
||||
if (!timepointId) {
|
||||
return;
|
||||
}
|
||||
var reviewerTimepoint = Reviewers.findOne({timepointId: timepointId});
|
||||
if (!reviewerTimepoint || !reviewerTimepoint.reviewers) {
|
||||
return;
|
||||
@@ -58,6 +64,9 @@ Meteor.methods({
|
||||
},
|
||||
|
||||
removeUserFromReviewers: function(userId) {
|
||||
if (!userId) {
|
||||
return;
|
||||
}
|
||||
Reviewers.find().map(function (timepoint) {
|
||||
Reviewers.update({_id: timepoint._id}, {"$pull": {"reviewers": {"userId": userId}}});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user