Files
natsdotnet/src/NATS.Server/Protocol/ClientCommandMatrix.cs
2026-02-23 05:41:42 -05:00

18 lines
390 B
C#

namespace NATS.Server.Protocol;
public sealed class ClientCommandMatrix
{
public bool IsAllowed(ClientKind kind, string? op)
{
if (string.IsNullOrWhiteSpace(op))
return true;
return (kind, op.ToUpperInvariant()) switch
{
(ClientKind.Router, "RS+") => true,
(_, "RS+") => false,
_ => true,
};
}
}