Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Created December 6, 2017 12:35
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 HamidMosalla/602067f9de2602a982ce2afbe192e0d4 to your computer and use it in GitHub Desktop.
Save HamidMosalla/602067f9de2602a982ce2afbe192e0d4 to your computer and use it in GitHub Desktop.
[Produces("application/json")]
public class IdentityController : Controller
{
[HttpGet]
[Authorize("Founder")]
[Route("api/resource-with-policy")]
public IActionResult ResourceWithPolicy()
{
return new JsonResult(new { ApiName = "Api1", AuthorizationType = "With Policy" });
}
[HttpGet]
[Authorize]
[Route("api/resource-without-policy")]
public IActionResult ResourceWithoutPolicy()
{
return new JsonResult(new { ApiName = "Api1", AuthorizationType = "Without Policy" });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment