aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Auth/Attribute.cs
blob: 51e20bdff6c3017d09000cc6702118ab16930492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Microsoft.AspNetCore.Authorization;
using TimelineApp.Entities;

namespace TimelineApp.Auth
{
    public class AdminAuthorizeAttribute : AuthorizeAttribute
    {
        public AdminAuthorizeAttribute()
        {
            Roles = UserRoles.Admin;
        }
    }

    public class UserAuthorizeAttribute : AuthorizeAttribute
    {
        public UserAuthorizeAttribute()
        {
            Roles = UserRoles.User;
        }
    }
}