package executor

import (
	"fmt"

	"github.com/everything-on-mysql/cassandra-on-mysql/pkg/cql/cqlerrors"
	"github.com/everything-on-mysql/cassandra-on-mysql/pkg/cql/keyspace"
)

func validateBlockedKeyspace(name string) error {
	if keyspace.IsBlocked(name) {
		return cqlerrors.Unauthorized(fmt.Sprintf("keyspace %q is not accessible", name))
	}
	return nil
}
