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

@@ -42,7 +42,7 @@ public interface IUser : IMembershipUser, IRememberBeingDirty
/// <summary>
/// The type of user.
/// </summary>
UserType Type { get; set; }
UserKind Kind { get; set; }
void RemoveGroup(string group);

View File

@@ -0,0 +1,7 @@
namespace Umbraco.Cms.Core.Models.Membership;
public enum MemberKind
{
Default = 0,
Api
}

View File

@@ -41,7 +41,7 @@ public class User : EntityBase, IUser, IProfile
private HashSet<IReadOnlyUserGroup> _userGroups;
private string _username;
private UserType _type;
private UserKind _kind;
/// <summary>
/// Constructor for creating a new/empty user
@@ -359,10 +359,10 @@ public class User : EntityBase, IUser, IProfile
}
[DataMember]
public UserType Type
public UserKind Kind
{
get => _type;
set => SetPropertyValueAndDetectChanges(value, ref _type, nameof(Type));
get => _kind;
set => SetPropertyValueAndDetectChanges(value, ref _kind, nameof(Kind));
}
/// <summary>

View File

@@ -1,6 +1,6 @@
namespace Umbraco.Cms.Core.Models.Membership;
public enum UserType
public enum UserKind
{
Default = 0,
Api

View File

@@ -12,7 +12,7 @@ public class UserCreateModel
public string Name { get; set; } = string.Empty;
public UserType Type { get; set; }
public UserKind Kind { get; set; }
public ISet<Guid> UserGroupKeys { get; set; } = new HashSet<Guid>();
}