From 4c1a20746abc3354d67ffd7ef65e8639e70cd63a Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Sun, 20 Oct 2019 16:47:17 +0800 Subject: ... --- .../Controllers/Testing/TestingAuthController.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Timeline/Controllers/Testing/TestingAuthController.cs (limited to 'Timeline/Controllers/Testing') diff --git a/Timeline/Controllers/Testing/TestingAuthController.cs b/Timeline/Controllers/Testing/TestingAuthController.cs new file mode 100644 index 00000000..488a3cff --- /dev/null +++ b/Timeline/Controllers/Testing/TestingAuthController.cs @@ -0,0 +1,32 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Timeline.Authenticate; + +namespace Timeline.Controllers.Testing +{ + [Route("testing/auth")] + [ApiController] + public class TestingAuthController : Controller + { + [HttpGet("[action]")] + [Authorize] + public ActionResult Authorize() + { + return Ok(); + } + + [HttpGet("[action]")] + [UserAuthorize] + public new ActionResult User() + { + return Ok(); + } + + [HttpGet("[action]")] + [AdminAuthorize] + public ActionResult Admin() + { + return Ok(); + } + } +} -- cgit v1.2.3