checkpoint

This commit is contained in:
2021-12-19 17:52:23 -06:00
parent 433ab2772a
commit a18b7974c8
5 changed files with 231 additions and 155 deletions

View File

@@ -241,6 +241,21 @@ namespace Gameboard.ShogiUI.Sockets.Controllers
return Ok();
}
[Authorize(Roles = "Admin, Shogi")]
[HttpDelete("{gameName}")]
public async Task<IActionResult> DeleteSession([FromRoute] string gameName)
{
var user = await ReadUserOrThrow();
if (user.IsAdmin)
{
return Ok();
}
else
{
return Unauthorized();
}
}
private async Task<Models.User> ReadUserOrThrow()
{
var user = await gameboardManager.ReadUser(User);