diff options
author | 杨宇千 <crupest@outlook.com> | 2019-07-23 18:01:04 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-07-23 18:01:04 +0800 |
commit | e34873c8cec905cd38c754d8968e848c9d0db5c2 (patch) | |
tree | a63911cb371b8ca01370e9c0d2aceb1811d00a8e /Timeline/Authenticate/Attribute.cs | |
parent | 1e5ac670386614b2d88da0af198a6b3df004f1dd (diff) | |
download | timeline-e34873c8cec905cd38c754d8968e848c9d0db5c2.tar.gz timeline-e34873c8cec905cd38c754d8968e848c9d0db5c2.tar.bz2 timeline-e34873c8cec905cd38c754d8968e848c9d0db5c2.zip |
WIP: Change UserController.
Diffstat (limited to 'Timeline/Authenticate/Attribute.cs')
-rw-r--r-- | Timeline/Authenticate/Attribute.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Timeline/Authenticate/Attribute.cs b/Timeline/Authenticate/Attribute.cs new file mode 100644 index 00000000..50b2681d --- /dev/null +++ b/Timeline/Authenticate/Attribute.cs @@ -0,0 +1,21 @@ +using Microsoft.AspNetCore.Authorization; +using Timeline.Models; + +namespace Timeline.Authenticate +{ + public class AdminAuthorizeAttribute : AuthorizeAttribute + { + public AdminAuthorizeAttribute() + { + Roles = UserRoles.Admin; + } + } + + public class UserAuthorizeAttribute : AuthorizeAttribute + { + public UserAuthorizeAttribute() + { + Roles = UserRoles.User; + } + } +} |