using System.Security.Claims;
namespace ZB.MOM.WW.MxGateway.Server.Dashboard;
///
/// Decides whether a dashboard principal may observe one session's mirrored
/// event stream (SEC-25 / TST-15). Consulted at every subscribe seam: the
/// SignalR EventsHub.SubscribeSession join and the in-process
/// IDashboardSessionEventSubscriber.Subscribe used by the
/// session-details page.
///
///
/// The dashboard authenticates LDAP users while sessions are owned by API keys —
/// two disjoint identity domains — so the bridge is the session tag: a
/// session inherits its owning key's tags, and a dashboard group grants tags via
/// MxGateway:Dashboard:GroupToTag. See
/// docs/plans/2026-07-10-dashboard-session-acl-tst15.md.
///
public interface IDashboardSessionAcl
{
///
/// Returns whether may observe the events of the
/// session identified by .
///
///
/// The dashboard caller. is denied outright — there is no
/// caller to grant tags to, so it never reaches the untagged-session branch and is
/// refused even under UntaggedSessionVisibility=AllViewers. An
/// unauthenticated or claim-less principal (the anonymous-localhost path included)
/// is a Viewer holding an empty tag grant, which denies every tagged session but
/// still follows that branch.
///
/// Session id the caller wants to observe.
/// when the caller may observe the session; otherwise .
bool CanViewSession(ClaimsPrincipal? principal, string sessionId);
}