Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Created December 5, 2017 00:01
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/daf39da79603c0e264a2b1dcfb66e3c8 to your computer and use it in GitHub Desktop.
Save HamidMosalla/daf39da79603c0e264a2b1dcfb66e3c8 to your computer and use it in GitHub Desktop.
namespace ApiResource.Controllers
{
[Produces("application/json")]
[Authorize]
[Route("api/ApiResourceWithoutPolicy")]
public class ApiResourceWithoutPolicyController : Controller
{
[HttpGet]
public IActionResult Get()
{
return new JsonResult(new { ResourceType = "Without Policy", ResourceName = "Api1" });
}
}
[Produces("application/json")]
[Authorize("Founder")]
[Route("api/ApiResourceWithPolicy")]
public class ApiResourceWithPolicyController : Controller
{
[HttpGet]
public IActionResult Get()
{
return new JsonResult(new { ResourceType = "With Policy", ResourceName = "Api2" });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment