addfunfacts
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-05-19 17:56:56 +02:00
parent 8cd1e10cd7
commit 634488c2d8
107 changed files with 5270 additions and 289 deletions

View File

@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Authorization;
using HanyadikHetVan.Data.Entities;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Data;
using System.Net.Mime;
using System.Security.Claims;
@ -12,9 +14,9 @@ namespace HanyadikHetVan.Controllers.V1
[ApiController]
public class TestController : Controller
{
private UserManager<IdentityUser> _userManager;
private UserManager<User> _userManager;
public TestController(UserManager<IdentityUser> userManager)
public TestController(UserManager<User> userManager)
{
_userManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
}
@ -32,7 +34,7 @@ namespace HanyadikHetVan.Controllers.V1
[Produces(MediaTypeNames.Application.Json)]
public string Protected()
{
return this.User.FindFirst(ClaimTypes.NameIdentifier).Value;
return this.User.FindFirst(ClaimTypes.Role).Value;
}
[Authorize(Roles = "admin")]