text: module.exports.updateRoles = (roles, newRoles) => {
      
      for (let newRole of newRoles) {
          let role = newRole.role;
          let hasRole = newRole.hasRole;
  
          let index = roles.indexOf(role);
  
          if (index > -1 && !hasRole) {
              roles.splice(index, 1);
          } else if (index == -1 && hasRole) {
              roles.push(role)
          }
      }
  
      return roles
  }
  
  module.exports.hasRole = (user, role) => {
      return (user.roles && user.roles.includes(role))
  }