Created
December 6, 2017 12:35
-
-
Save HamidMosalla/602067f9de2602a982ce2afbe192e0d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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