parent
26c255ed55
commit
23219cd686
@ -1,6 +0,0 @@ |
||||
Meteor.methods({ |
||||
unsetUserReason(userId) { |
||||
Meteor.users.update(userId, { $unset: { 'reason' : 1 } }); |
||||
return true; |
||||
} |
||||
}); |
||||
@ -1,27 +0,0 @@ |
||||
Meteor.methods({ |
||||
unsetUserReason(userId) { |
||||
check(userId, String); |
||||
|
||||
if (!Meteor.userId()) { |
||||
throw new Meteor.Error('error-invalid-user', 'Invalid user', { |
||||
method: 'unsetUserReason' |
||||
}); |
||||
} |
||||
|
||||
if (RocketChat.authz.hasPermission(Meteor.userId(), 'edit-other-user-active-status') !== true) { |
||||
throw new Meteor.Error('error-not-allowed', 'Not allowed', { |
||||
method: 'unsetUserReason' |
||||
}); |
||||
} |
||||
|
||||
const user = RocketChat.models.Users.findOneById(userId); |
||||
|
||||
if (user) { |
||||
RocketChat.models.Users.unsetReason(userId); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
}); |
||||
Loading…
Reference in new issue