aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/TestController.cs
blob: 1563830c8df3d9e853ee3a058a8414ce3ed321d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Timeline.Controllers
{
    [Route("api/[controller]")]
    public class TestController : Controller
    {
        [HttpGet("[action]")]
        [Authorize]
        public string Action1()
        {
            return "test";
        }

        [HttpGet("[action]")]
        [Authorize(Roles = "User,Admin")]
        public string Action2()
        {
            return "test";
        }

        [HttpGet("[action]")]
        [Authorize(Roles = "Admin")]
        public string Action3()
        {
            return "test";
        }
    }
}