aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Authenticate
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-07-23 18:01:04 +0800
committer杨宇千 <crupest@outlook.com>2019-07-23 18:01:04 +0800
commitc84faf2b8f5a55ae170e92ead6516e573a318e65 (patch)
treea63911cb371b8ca01370e9c0d2aceb1811d00a8e /Timeline/Authenticate
parent79d4c444ace7cb10fbd638936c2e47a6314d2758 (diff)
downloadtimeline-c84faf2b8f5a55ae170e92ead6516e573a318e65.tar.gz
timeline-c84faf2b8f5a55ae170e92ead6516e573a318e65.tar.bz2
timeline-c84faf2b8f5a55ae170e92ead6516e573a318e65.zip
WIP: Change UserController.
Diffstat (limited to 'Timeline/Authenticate')
-rw-r--r--Timeline/Authenticate/Attribute.cs21
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;
+ }
+ }
+}