Add member "kind" - and refactor user "type" to "kind" for consistency (#16979)

* Rename UserType to UserKind

* Add MemberKind to tell API members from regular ones

* Remove user kind from invite user endpoint

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
This commit is contained in:
Kenn Jacobsen
2024-09-03 10:43:09 +02:00
committed by GitHub
parent 2a6b376f0d
commit 874055eeab
28 changed files with 129 additions and 73 deletions

View File

@@ -49,7 +49,7 @@ public partial class UserServiceCrudTests
Email = "some@one",
Name = "Some One",
UserGroupKeys = new HashSet<Guid> { userGroup.Key },
Type = UserType.Api
Kind = UserKind.Api
};
var userKey = (await userService.CreateAsync(Constants.Security.SuperUserKey, creationModel, true)).Result.CreatedUser!.Key;

View File

@@ -50,12 +50,12 @@ public partial class UserServiceCrudTests
Assert.IsNotNull(createdUser);
Assert.AreEqual(username, createdUser.Username);
Assert.AreEqual(email, createdUser.Email);
Assert.AreEqual(UserType.Default, createdUser.Type);
Assert.AreEqual(UserKind.Default, createdUser.Kind);
}
[TestCase(UserType.Default)]
[TestCase(UserType.Api)]
public async Task Can_Create_All_User_Types(UserType type)
[TestCase(UserKind.Default)]
[TestCase(UserKind.Api)]
public async Task Can_Create_All_User_Types(UserKind kind)
{
var securitySettings = new SecuritySettings();
var userService = CreateUserService(securitySettings);
@@ -67,7 +67,7 @@ public partial class UserServiceCrudTests
Email = "api@local",
Name = "API user",
UserGroupKeys = new HashSet<Guid> { userGroup.Key },
Type = type
Kind = kind
};
var result = await userService.CreateAsync(Constants.Security.SuperUserKey, creationModel, true);
@@ -76,11 +76,11 @@ public partial class UserServiceCrudTests
Assert.AreEqual(UserOperationStatus.Success, result.Status);
var createdUser = result.Result.CreatedUser;
Assert.IsNotNull(createdUser);
Assert.AreEqual(type, createdUser.Type);
Assert.AreEqual(kind, createdUser.Kind);
var user = await userService.GetAsync(createdUser.Key);
Assert.NotNull(user);
Assert.AreEqual(type, user.Type);
Assert.AreEqual(kind, user.Kind);
}
[Test]