Authorize API
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 40s
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 40s
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using GameIdeas.Shared.Dto;
|
||||
using GameIdeas.Shared.Constants;
|
||||
using GameIdeas.Shared.Dto;
|
||||
using GameIdeas.WebAPI.Services.Games;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace GameIdeas.WebAPI.Controllers;
|
||||
@@ -42,6 +44,7 @@ public class GameController(
|
||||
}
|
||||
}
|
||||
|
||||
[Authorize(Roles = GlobalConstants.ADMIN_MEMBER)]
|
||||
[HttpPost("Create")]
|
||||
public async Task<ActionResult<int>> CreateGame([FromBody] GameDetailDto game)
|
||||
{
|
||||
@@ -57,6 +60,7 @@ public class GameController(
|
||||
}
|
||||
}
|
||||
|
||||
[Authorize(Roles = GlobalConstants.ADMIN_MEMBER)]
|
||||
[HttpPut("Update")]
|
||||
public async Task<ActionResult<int>> UpdateGame([FromBody] GameDetailDto game)
|
||||
{
|
||||
@@ -72,6 +76,7 @@ public class GameController(
|
||||
}
|
||||
}
|
||||
|
||||
[Authorize(Roles = GlobalConstants.ADMIN_MEMBER)]
|
||||
[HttpDelete("Delete/{id:int}")]
|
||||
public async Task<ActionResult<bool>> DeleteGame(int id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user