code: func hasAuthorization(r *http.Request, username string, globalid string) (bool, error) {
  	userMgr := user.NewManager(r)
  
  	authorization, err := userMgr.GetAuthorization(username, globalid)
  	if err != nil && !db.IsNotFound(err) {
  		return false, err
  	}
  	if authorization == nil || db.IsNotFound(err) {
  		return false, nil
  	}
  	return true, nil
  }
docs: // hasAuthorization checks if a user has an open authorization for an organization