Add the ability for the admin :

- disabling a login for a user (not himself)
- enabling a login for a user
- transfering the ownership of all user's boards to himself
This commit is contained in:
soohwa 2017-10-13 08:15:19 +02:00
parent 3ab33ed826
commit 77d23df87f
3 changed files with 53 additions and 1 deletions

View file

@ -298,6 +298,15 @@ Boards.mutations({
return { $pull: { labels: { _id: labelId } } };
},
changeOwnership(fromId, toId) {
const memberIndex = this.memberIndex(fromId);
return {
$set: {
[`members.${memberIndex}.userId`]: toId,
},
};
},
addMember(memberId) {
const memberIndex = this.memberIndex(memberId);
if (memberIndex >= 0) {
@ -565,7 +574,7 @@ if (Meteor.isServer) {
const data = Boards.find({
archived: false,
'members.userId': req.userId,
'members.userId': paramUserId,
}, {
sort: ['title'],
}).map(function(board) {