using Grpc.Core;

namespace ZB.MOM.WW.GalaxyRepository.Grpc;

/// <summary>
///     Resolves the browse-subtree glob patterns the current caller is allowed to see.
///     Lets a hosting gateway scope <see cref="GalaxyRepositoryGrpcService"/> results per
///     identity without the library knowing the host's authorization model. The default
///     <see cref="NullGalaxyBrowseScopeProvider"/> applies no scoping (full hierarchy).
/// </summary>
public interface IGalaxyBrowseScopeProvider
{
    /// <summary>
    ///     Returns the allowed browse-subtree globs for the current call, or
    ///     <see langword="null"/>/empty for no restriction (full hierarchy).
    /// </summary>
    /// <param name="context">The gRPC server call context for the current request.</param>
    /// <returns>The allowed browse-subtree globs, or <see langword="null"/> for no restriction.</returns>
    IReadOnlyList<string>? ResolveBrowseSubtrees(ServerCallContext context);
}
