Skip to content

Instantly share code, notes, and snippets.

@wellingtonjhn
Last active May 28, 2018 02:04
Show Gist options
  • Save wellingtonjhn/d6c9370eddb18e238fd4c8f9f639ea26 to your computer and use it in GitHub Desktop.
Save wellingtonjhn/d6c9370eddb18e238fd4c8f9f639ea26 to your computer and use it in GitHub Desktop.
AdministrationController - AuthorizeAttribute
[Route("api/[controller]"), Authorize(Roles = "Administrator")]
public class AdministrationController : Controller
{
[HttpGet, Route("accounts")]
public async Task<IActionResult> ListUsers()
{
// ... conteúdo omitido
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment