Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DevHive.Services / Services / RoleService.cs
diff options
context:
space:
mode:
Commit5811d878180a85af5c41b9cb3b8f272d589539e9 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2020-12-17 11:21:14 +0200
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2020-12-17 11:21:14 +0200
Files16c27c0c797f004d20634e29d1752c994386537d /src/DevHive.Services/Services/RoleService.cs
DevHive-5811d878180a85af5c41b9cb3b8f272d589539e9.tar
DevHive-5811d878180a85af5c41b9cb3b8f272d589539e9.tar.gz
DevHive-5811d878180a85af5c41b9cb3b8f272d589539e9.zip
Parentedf40b339c999c936d0e022100d67c853cd1b792 (diff)
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
1 files changed, 2 insertions, 2 deletions
-rw-r--r--src/DevHive.Services/Services/RoleService.cs4
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<IActionResult> 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<Role>(roleServiceModel);