615b487a77
Adds missing <summary>/<param> XML docs across 99 server, worker, and test files so CommentChecker reports zero issues (TreatWarningsAsErrors needs the analyzer clean). Bundles in WIP dashboard work: NavSection extraction, MainLayout/site.css/js styling alignment, and DashboardOptions/Auth tweaks.
19 lines
489 B
C#
19 lines
489 B
C#
using System.Security.Claims;
|
|
|
|
namespace ZB.MOM.WW.MxGateway.Server.Dashboard;
|
|
|
|
public sealed class DashboardApiKeyAuthorization
|
|
{
|
|
/// <summary>Determines whether the user can manage API keys.</summary>
|
|
/// <param name="user">The authenticated user principal.</param>
|
|
public bool CanManage(ClaimsPrincipal user)
|
|
{
|
|
if (user.Identity?.IsAuthenticated != true)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return user.IsInRole(DashboardRoles.Admin);
|
|
}
|
|
}
|