diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-24 20:15:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-24 20:15:58 +0800 |
commit | 4ab69665f26aaa59bad8684e6b801b4c4cf900cd (patch) | |
tree | 7ca5010a06829cc5fadea1ea17ae72d082fc344c /Timeline/Controllers/Testing/TestingAuthController.cs | |
parent | 21de8da2feab19d3fbc392e71bf0dcec25ec8d6b (diff) | |
parent | 2bc4c701f9cdff1fdd11a5736c33a5818fbae3e9 (diff) | |
download | timeline-4ab69665f26aaa59bad8684e6b801b4c4cf900cd.tar.gz timeline-4ab69665f26aaa59bad8684e6b801b4c4cf900cd.tar.bz2 timeline-4ab69665f26aaa59bad8684e6b801b4c4cf900cd.zip |
Merge pull request #50 from crupest/refactor
Refactor : A Huge Step
Diffstat (limited to 'Timeline/Controllers/Testing/TestingAuthController.cs')
-rw-r--r-- | Timeline/Controllers/Testing/TestingAuthController.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Timeline/Controllers/Testing/TestingAuthController.cs b/Timeline/Controllers/Testing/TestingAuthController.cs new file mode 100644 index 00000000..67b5b2ef --- /dev/null +++ b/Timeline/Controllers/Testing/TestingAuthController.cs @@ -0,0 +1,32 @@ +using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Timeline.Authentication;
+
+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();
+ }
+ }
+}
|