You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: authorizer.go
    path of file: ./repos/cockroach/pkg/multitenant/tenantcapabilities/tenantcapabilitiesauthorizer
    
    the code of the file until where you have to start completion: // Copyright 2023 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, 
    
func (a *Authorizer) HasTSDBQueryCapability(ctx context.Context, tenID roachpb.TenantID) error {
	if tenID.IsSystem() {
		return nil
	}

	entry, mode := a.getMode(ctx, tenID)
	switch mode {
	case authorizerModeOn:
		break // fallthrough to the next check.
	case authorizerModeAllowAll:
		return nil
	case authorizerModeV222:
		return errCannotQueryTSDB
	default:
		err := errors.AssertionFailedf("unknown authorizer mode: %d", mode)
		logcrash.ReportOrPanic(ctx, &a.settings.SV, "%v", err)
		return err
	}

	if !tenantcapabilities.MustGetBoolByID(
		entry.TenantCapabilities, tenantcapabilities.CanViewTSDBMetrics,
	) {
		return errCannotQueryTSDB
	}
	return nil
}