Code/SboxSuperuser/Engine/Authority/HostPolicyService.Admin.cs

Partial of HostPolicyService in an authority layer. Returns the role labels for a Steam ID: "owner" for the host owner, otherwise the groups the policy resolver marks as applicable for that player's claims. Intended for a moderation reader that has already been authorized.

namespace SboxSuperuser.Engine.Authority;

internal sealed partial class HostPolicyService
{
	// Only called after the administration query has authorized a moderation reader.
	internal string[] ReadRoleLabels( string steamId ) => IsOwner( steamId ) ? new[] { "owner" }
		: _resolver.Policy.ApplicableGroups( steamId, _resolver.Claims ).ToArray();
}