Commit 1ec9f69c by GD-A-150752

remove-user-status-extra-method

parent 44a764a1
...@@ -10,6 +10,7 @@ export const PERMISSIONS = { ...@@ -10,6 +10,7 @@ export const PERMISSIONS = {
CAN_ACCESS_EMAIL_TEMPLATES: 'CAN_ACCESS_EMAIL_TEMPLATES', CAN_ACCESS_EMAIL_TEMPLATES: 'CAN_ACCESS_EMAIL_TEMPLATES',
CAN_UPDATE_ALL_USERS: 'CAN_UPDATE_ALL_USERS', CAN_UPDATE_ALL_USERS: 'CAN_UPDATE_ALL_USERS',
CAN_ACCESS_USERS_PAGE: 'CAN_ACCESS_USERS_PAGE', CAN_ACCESS_USERS_PAGE: 'CAN_ACCESS_USERS_PAGE',
CAN_ACCESS_PROFILE: 'CAN_ACCESS_PROFILE',
}; };
export const CONFIG = { export const CONFIG = {
......
...@@ -104,21 +104,4 @@ Meteor.methods({ ...@@ -104,21 +104,4 @@ Meteor.methods({
return Accounts.findUserByEmail(email); return Accounts.findUserByEmail(email);
}, },
switchUser(user: Meteor.User, block = false): any {
if (UtilsService.hasPermission(PERMISSIONS.CAN_UPDATE_USER)) {
if (block) {
const disableRole = rolesCollection.findOne({ title: 'Blocked' });
user.profile.originalRole = user.profile.role;
user.profile.role = disableRole._id;
} else {
user.profile.role = user.profile.originalRole;
delete user.profile.originalRole;
}
return Meteor.users.update(user._id, user);
}
throw new Meteor.Error(E_CODE.FORBIDDEN, ERR.FORBIDDEN);
},
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment