package checker

import (
	"context"

	"github.com/tidbcloud/tiinf/monitor/tilog"
	"go.uber.org/zap"
	"google.golang.org/grpc"
)

// ZeroPermissionCheckerFunc is a permission checker for tidb cloud zero, which does not perform any permission check and allows all requests to pass through.
func ZeroPermissionCheckerFunc(
	ctx context.Context,
	_ *CheckContext,
	req any,
	info *grpc.UnaryServerInfo,
) (context.Context, any, error) {
	tilog.Info(ctx, "not need to check permission for zero",
		zap.String("method", info.FullMethod))
	return ctx, req, nil
}
