aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Authentication/Attribute.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline/Authentication/Attribute.cs')
-rw-r--r--Timeline/Authentication/Attribute.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Timeline/Authentication/Attribute.cs b/Timeline/Authentication/Attribute.cs
new file mode 100644
index 00000000..370b37e1
--- /dev/null
+++ b/Timeline/Authentication/Attribute.cs
@@ -0,0 +1,21 @@
+using Microsoft.AspNetCore.Authorization;
+using Timeline.Entities;
+
+namespace Timeline.Authentication
+{
+ public class AdminAuthorizeAttribute : AuthorizeAttribute
+ {
+ public AdminAuthorizeAttribute()
+ {
+ Roles = UserRoles.Admin;
+ }
+ }
+
+ public class UserAuthorizeAttribute : AuthorizeAttribute
+ {
+ public UserAuthorizeAttribute()
+ {
+ Roles = UserRoles.User;
+ }
+ }
+}