code: func IsAllowed(c context.Context, project string) (bool, error) {
  	switch admin, err := IsAdmin(c); {
  	case err != nil:
  		return false, err
  	case admin:
  		return true, nil
  	}
  
  	// Get the project, because that's where the ACLs lie.
  	err := access.Check(c, backend.AsUser, config.ProjectSet(project))
  	innerError := errors.Unwrap(err)
  
  	switch {
  	case err == nil:
  		return true, nil
  	case err == access.ErrNoAccess:
  		return false, nil
  	case innerError == config.ErrNoConfig:
  		return false, grpcutil.NotFoundTag.Apply(err)
  	default:
  		return false, err
  	}
  }
docs: // Helper functions for ACL checking.
  // IsAllowed checks to see if the user in the context is allowed to access
  // the given project.