Revize 23165326
Přidáno uživatelem Vojtěch Bartička před asi 3 roky(ů)
Backend/Backend/Authentication/AuthorizationAttribute.cs | ||
---|---|---|
1 | 1 |
using Core.Entities; |
2 |
using Core.Enums;
|
|
2 |
using Models.Enums;
|
|
3 | 3 |
using Microsoft.AspNetCore.Authorization; |
4 | 4 |
using Microsoft.AspNetCore.Mvc; |
5 | 5 |
using Microsoft.AspNetCore.Mvc.Filters; |
Backend/Backend/Controllers/DocumentController.cs | ||
---|---|---|
25 | 25 |
} |
26 | 26 |
|
27 | 27 |
[HttpGet("/documents")] |
28 |
[Authorize(Core.Enums.ERole.ADMINISTRATOR)]
|
|
28 |
[Authorize(Models.Enums.ERole.ADMINISTRATOR)]
|
|
29 | 29 |
[ProducesResponseType((int)HttpStatusCode.OK)] |
30 | 30 |
[ProducesResponseType((int)HttpStatusCode.Forbidden)] |
31 | 31 |
public ActionResult<DocumentListResponse> GetDocuments([FromServices] ClientInfo clientInfo, [FromBody] DocumentListRequest documentListRequest) |
... | ... | |
40 | 40 |
} |
41 | 41 |
|
42 | 42 |
[HttpPost("/documents")] |
43 |
[Authorize(Core.Enums.ERole.ADMINISTRATOR)]
|
|
43 |
[Authorize(Models.Enums.ERole.ADMINISTRATOR)]
|
|
44 | 44 |
[ProducesResponseType((int)HttpStatusCode.OK)] |
45 | 45 |
[ProducesResponseType((int)HttpStatusCode.Forbidden)] |
46 | 46 |
public ActionResult PostDocuments([FromServices] ClientInfo clientInfo, [FromBody] DocumentAddRequest documentAddRequest) |
Také k dispozici: Unified diff
Fixed problems after a merge