code: func (m *Manager) UpserGrant(username, globalID string, grant Grant) error {
  	// Count the amount of grants we already have first
  	sg, err := m.GetGrantsForUser(username, globalID)
  	if err != nil && !db.IsNotFound(err) {
  		return err
  	}
  	if db.IsNotFound(err) {
  		sg = &SavedGrants{}
  	}
  	if len(sg.Grants) >= maxGrants {
  		return ErrGrantLimitReached
  	}
  
  	_, err = m.collection.Upsert(bson.M{"username": username, "globalid": globalID}, bson.M{"$addToSet": bson.M{"grants": grant}})
  	return err
  }
docs: // UpserGrant adds a new grent for a user by an organization