30 lines
828 B
C#
30 lines
828 B
C#
|
|
|
|||
|
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
|||
|
|
using Microsoft.AspNetCore.Authorization;
|
|||
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
|
|||
|
|
namespace phronCare.API.Controllers
|
|||
|
|
{
|
|||
|
|
//[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
|||
|
|
[Route("api/[controller]")]
|
|||
|
|
[ApiController]
|
|||
|
|
|
|||
|
|
public class TestController : ControllerBase
|
|||
|
|
{
|
|||
|
|
[Authorize(Roles = "User")]
|
|||
|
|
[HttpGet("empleados")]
|
|||
|
|
public IEnumerable<string> GetEmpleados()
|
|||
|
|
{
|
|||
|
|
return new List<string> { "Leandro", "Griselda", "Agustin","Victoria" };
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Authorize (Roles ="Admin")]
|
|||
|
|
[HttpGet("administradores")]
|
|||
|
|
|
|||
|
|
public IEnumerable<string> GetAdministradores()
|
|||
|
|
{
|
|||
|
|
return new List<string> { "Leandro", "Griselda", "Agustin", "Victoria" };
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|