16 lines
448 B
C#
16 lines
448 B
C#
using Tiku.Application.PlatformAdmin;
|
|
using Tiku.Application.Security;
|
|
|
|
namespace Tiku.Api.Controllers;
|
|
|
|
public sealed class PlatformAdminActorResolver(ICurrentUser currentUser)
|
|
{
|
|
internal PlatformAdminActor Resolve()
|
|
{
|
|
if (currentUser.UserId is not { } userId)
|
|
throw new PlatformAdminException("Platform admin actor was not resolved.", "platform_access_denied");
|
|
|
|
return new PlatformAdminActor(userId);
|
|
}
|
|
}
|