Files
2026-10-16 23:33:13 -07:00

23 lines
503 B
C#

using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using RadicadeServer.DB;
namespace RadicadeServer.API
{
[Route("role")]
[Route("auth/role")]
public class RolesAPI(RecDBContext db) : Controller
{
[HttpGet("{roleType}/{id}")]
public async Task<bool> GetDeveloperRole(string roleType, long id)
{
var player = await db.Profiles.FirstOrDefaultAsync(x => x.accountId == id);
if (player != null)
{
return player.HasRole(roleType);
}
return false;
}
}
}