code: func getGrants(username, clientID string, r *http.Request) ([]string, error) {
  
  	// Add grants
  	grantMgr := grants.NewManager(r)
  	rawGrants, err := grantMgr.GetGrantsForUser(username, clientID)
  	if err != nil && !db.IsNotFound(err) {
  		return nil, err
  	}
  	if err != nil {
  		rawGrants = &grants.SavedGrants{Grants: []grants.Grant{}}
  	}
  
  	fullGrants := make([]string, len(rawGrants.Grants))
  	for i, g := range rawGrants.Grants {
  		fullGrants[i] = grants.FullName(g)
  	}
  
  	log.Debug("Found ", len(fullGrants), " grant(s)")
  	return fullGrants, nil
  }
docs: // getGrants returns a list of all the grants for a user