Skip to content

Instantly share code, notes, and snippets.

@JudahGabriel
Created September 27, 2017 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudahGabriel/5332236dbd63a4a80641d112b4f59609 to your computer and use it in GitHub Desktop.
Save JudahGabriel/5332236dbd63a4a80641d112b4f59609 to your computer and use it in GitHub Desktop.
public class HomeController : Controller
{
[Authorize] // Authorize: the user must be signed in
public IActionResult Index()
{
}
[Authorize(Roles = "Admin"] // Authorize: the signed in user must be an admin
public IActionResult Index()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment