Set OperateMachines policy at controller level

master
Tudor Stanciu 2023-04-17 04:28:31 +03:00
parent c94acf9ba4
commit f1a7056f18
1 changed files with 1 additions and 2 deletions

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace NetworkResurrector.Api.Controllers namespace NetworkResurrector.Api.Controllers
{ {
[Authorize] [Authorize(Policy = Policies.OperateMachines)]
[ApiController] [ApiController]
[Route("resurrector")] [Route("resurrector")]
public class ResurrectorController : ControllerBase public class ResurrectorController : ControllerBase
@ -27,7 +27,6 @@ namespace NetworkResurrector.Api.Controllers
} }
[HttpPost("ping")] [HttpPost("ping")]
[Authorize(Policy = Policies.OperateMachines)]
public async Task<IActionResult> PingMachine([FromBody] PingMachine pingMachine) public async Task<IActionResult> PingMachine([FromBody] PingMachine pingMachine)
{ {
var result = await _mediator.Send(pingMachine); var result = await _mediator.Send(pingMachine);