diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-31 00:56:46 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-10-31 00:56:46 +0800 |
commit | d3a1bf5f2939049f11e77f91ad9ddea30d8acd64 (patch) | |
tree | 7d034bb824b50d892136c6f1225a15e8baa30741 /Timeline/Auth/Attribute.cs | |
parent | 006d799d2fe5f081c188f95a8590c4b75a93caae (diff) | |
download | timeline-d3a1bf5f2939049f11e77f91ad9ddea30d8acd64.tar.gz timeline-d3a1bf5f2939049f11e77f91ad9ddea30d8acd64.tar.bz2 timeline-d3a1bf5f2939049f11e77f91ad9ddea30d8acd64.zip |
Continue to construct feature and tests.
Diffstat (limited to 'Timeline/Auth/Attribute.cs')
-rw-r--r-- | Timeline/Auth/Attribute.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Timeline/Auth/Attribute.cs b/Timeline/Auth/Attribute.cs new file mode 100644 index 00000000..86d0109b --- /dev/null +++ b/Timeline/Auth/Attribute.cs @@ -0,0 +1,21 @@ +using Microsoft.AspNetCore.Authorization;
+using Timeline.Entities;
+
+namespace Timeline.Auth
+{
+ public class AdminAuthorizeAttribute : AuthorizeAttribute
+ {
+ public AdminAuthorizeAttribute()
+ {
+ Roles = UserRoles.Admin;
+ }
+ }
+
+ public class UserAuthorizeAttribute : AuthorizeAttribute
+ {
+ public UserAuthorizeAttribute()
+ {
+ Roles = UserRoles.User;
+ }
+ }
+}
|