mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-25 23:18:56 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user