我正在尝试添加角色包,然后设置一个自定义用户角色,如访客或成员,以便我可以将它与付费计划一起使用。我收到以下错误
Exception in defer callback: Error: When the modifier option is true, validation object must have at least one operator
at checkModifier (packages/aldeed:simple-schema/simple-schema-validation.js:271:1)
at doValidation1 (packages/aldeed:simple-schema/simple-schema-validation.js:321:1)
当我运行以下功能
Meteor.methods({
setUserRole: function(userId, roleToSet){
// check(Meteor.userId(), String);
check(userId, String );
check(roleToSet, String);
var user = Meteor.users.findOne(userId);
if (_.isEmpty(user.roles)) {
Roles.addUsersToRoles(userId, roleToSet);
}
}
});