From 5811d878180a85af5c41b9cb3b8f272d589539e9 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 17 Dec 2020 11:21:14 +0200 Subject: Roles are now in a seperate table, user can contain multiple roles (BUT JWT doesn't support mutiple yet), added migrations, userrepository returns user roles with the user --- src/DevHive.Services/Services/RoleService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/DevHive.Services/Services/RoleService.cs') diff --git a/src/DevHive.Services/Services/RoleService.cs b/src/DevHive.Services/Services/RoleService.cs index b3e734d..c04bf31 100644 --- a/src/DevHive.Services/Services/RoleService.cs +++ b/src/DevHive.Services/Services/RoleService.cs @@ -21,8 +21,8 @@ namespace DevHive.Services.Services public async Task CreateRole(RoleServiceModel roleServiceModel) { - if (!await this._roleRepository.DoesNameExist(roleServiceModel.Name)) - return new BadRequestObjectResult("Invalid role name!"); + if (await this._roleRepository.DoesNameExist(roleServiceModel.Name)) + return new BadRequestObjectResult("Role already exists!"); Role role = this._roleMapper.Map(roleServiceModel); -- cgit v1.2.3