Skip to content

Instantly share code, notes, and snippets.

@bernardoVale
Created March 30, 2013 01:08
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 bernardoVale/5274792 to your computer and use it in GitHub Desktop.
Save bernardoVale/5274792 to your computer and use it in GitHub Desktop.
Olha ai
if (HttpContext.User.Identity.IsAuthenticated)
{
if (UserAuthorization.IsAuthorized(AuthorizationType.Cliente))
{
//Tudo ok autenticado e autorizado
return View(cliente);
}
//Nao esta autorizado manda pro unauthorized
return RedirectToAction("Unauthorized", "Access");
}
//O Imbecil nem ta autenticado
return RedirectToAction("Index", "Access");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment