diff options
Diffstat (limited to 'API')
| -rw-r--r-- | API/Controllers/UserController.cs | 4 | ||||
| -rw-r--r-- | API/Database/DevHiveContext.cs | 2 | ||||
| -rw-r--r-- | API/Service/UserService.cs | 2 | ||||
| -rw-r--r-- | API/Startup.cs | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/API/Controllers/UserController.cs b/API/Controllers/UserController.cs index 922119e..187b4e9 100644 --- a/API/Controllers/UserController.cs +++ b/API/Controllers/UserController.cs @@ -5,7 +5,7 @@ using AutoMapper; using Microsoft.AspNetCore.Mvc; using Data.Models.DTOs; using Microsoft.AspNetCore.Authorization; - +using Data.Models.Classes; namespace API.Controllers { @@ -39,7 +39,7 @@ namespace API.Controllers //Read [HttpGet] - [Authorize(Roles = Data.Models.Classes.Roles.Admin)] + [Authorize(Roles = UserRoles.Admin)] public async Task<IActionResult> GetById(int id) { return await this._service.GetUserById(id); diff --git a/API/Database/DevHiveContext.cs b/API/Database/DevHiveContext.cs index f8ddf83..7cb8f16 100644 --- a/API/Database/DevHiveContext.cs +++ b/API/Database/DevHiveContext.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Identity; namespace API.Database { - public class DevHiveContext : IdentityDbContext<User, Roles, int> + public class DevHiveContext : IdentityDbContext<User, UserRoles, int> { public DevHiveContext(DbContextOptions options) : base(options) { } diff --git a/API/Service/UserService.cs b/API/Service/UserService.cs index 453e5f4..b715f8c 100644 --- a/API/Service/UserService.cs +++ b/API/Service/UserService.cs @@ -60,7 +60,7 @@ namespace API.Service User user = this._userMapper.Map<User>(userDTO); if (user.Role == null) - user.Role = Roles.User; + user.Role = UserRoles.User; await this._userDbRepository.AddAsync(user); diff --git a/API/Startup.cs b/API/Startup.cs index f5aeaad..d9388cf 100644 --- a/API/Startup.cs +++ b/API/Startup.cs @@ -35,7 +35,7 @@ namespace API services.AddDbContext<DevHiveContext>(options =>
options.UseNpgsql(Configuration.GetConnectionString("DEV")));
- services.AddIdentity<User, Roles>()
+ services.AddIdentity<User, UserRoles>()
.AddEntityFrameworkStores<DevHiveContext>();
services.Configure<IdentityOptions>(options =>
|
