diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-20 16:47:17 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-10-20 16:47:17 +0800 |
commit | 3b658ebab07f6e8dcce978138b0f17806eae798d (patch) | |
tree | 504d77d6210fd0d0a251dcf232231d96a0990c54 /Timeline/Controllers/Testing | |
parent | c9cc1e18fb36df25ad28778c26e4b2bd88b6a96d (diff) | |
download | timeline-3b658ebab07f6e8dcce978138b0f17806eae798d.tar.gz timeline-3b658ebab07f6e8dcce978138b0f17806eae798d.tar.bz2 timeline-3b658ebab07f6e8dcce978138b0f17806eae798d.zip |
...
Diffstat (limited to 'Timeline/Controllers/Testing')
-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..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();
+ }
+ }
+}
|