Example #1
0
 _.forEach(doc.roles, function (element) {
     let roleWords = _.words(element, /[^:]+/g);
     Roles.addUsersToRoles(_id,
         roleWords[1], // roles
         roleWords[0]); // [group]
 });
Example #2
0
 _.each(doc.roles, function (element) {
     let roleWords = _.words(element, /[^:]+/g);
     Roles.addUsersToRoles(userId,
         roleWords[1],
         roleWords[0]);
 });