code: func (a Sources) RequiredPrivileges() (ExecutionPrivileges, error) {
  	var ep ExecutionPrivileges
  	for _, source := range a {
  		switch source := source.(type) {
  		case *Measurement:
  			ep = append(ep, ExecutionPrivilege{
  				Name:      source.Database,
  				Privilege: ReadPrivilege,
  			})
  		case *SubQuery:
  			privs, err := source.Statement.RequiredPrivileges()
  			if err != nil {
  				return nil, err
  			}
  			ep = append(ep, privs...)
  		default:
  			return nil, fmt.Errorf("invalid source: %s", source)
  		}
  	}
  	return ep, nil
  }
docs: // RequiredPrivileges recursively returns a list of execution privileges required.