mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-25 23:18:56 -07:00
23 lines
503 B
C#
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;
|
|
}
|
|
}
|
|
}
|