code: function hasRole(user = null, role = null) {
    return user && role && user.hasRole(role);
  }
docs: This checks to see if the user has the given role.
  
  @param {object} user the user object
  @param {string} role the role
  @returns {boolean}  whether or not the user has the role