V14: Consistently refer to user key (#14685)

* Fixup UserService

* Fixup PartialViewService

* Fixup ScriptService

* Fixup StylesheetService

* Use keys with usergroups instead of IDs

* Fix missed instances of performingUser

* Fixup DataTypeFolderControllerBase

---------

Co-authored-by: kjac <kja@umbraco.dk>
This commit is contained in:
Mole
2023-08-17 08:35:48 +02:00
committed by GitHub
parent fb3ead87b8
commit a1f6531453
14 changed files with 121 additions and 115 deletions

View File

@@ -51,31 +51,31 @@ public interface IUserService : IMembershipUserService
/// <remarks>
/// This creates both the Umbraco user and the identity user.
/// </remarks>
/// <param name="performingUserKey">The key of the user performing the operation.</param>
/// <param name="userKey">The key of the user performing the operation.</param>
/// <param name="model">Model to create the user from.</param>
/// <param name="approveUser">Specifies if the user should be enabled be default. Defaults to false.</param>
/// <returns>An attempt indicating if the operation was a success as well as a more detailed <see cref="UserOperationStatus"/>.</returns>
Task<Attempt<UserCreationResult, UserOperationStatus>> CreateAsync(Guid performingUserKey, UserCreateModel model, bool approveUser = false);
Task<Attempt<UserCreationResult, UserOperationStatus>> CreateAsync(Guid userKey, UserCreateModel model, bool approveUser = false);
Task<Attempt<UserInvitationResult, UserOperationStatus>> InviteAsync(Guid performingUserKey, UserInviteModel model);
Task<Attempt<UserInvitationResult, UserOperationStatus>> InviteAsync(Guid userKey, UserInviteModel model);
Task<Attempt<UserOperationStatus>> VerifyInviteAsync(Guid userKey, string token);
Task<Attempt<PasswordChangedModel, UserOperationStatus>> CreateInitialPasswordAsync(Guid userKey, string token, string password);
Task<Attempt<IUser?, UserOperationStatus>> UpdateAsync(Guid performingUserKey, UserUpdateModel model);
Task<Attempt<IUser?, UserOperationStatus>> UpdateAsync(Guid userKey, UserUpdateModel model);
Task<UserOperationStatus> SetAvatarAsync(Guid userKey, Guid temporaryFileKey);
Task<UserOperationStatus> DeleteAsync(Guid key);
Task<UserOperationStatus> DisableAsync(Guid performingUserKey, ISet<Guid> keys);
Task<UserOperationStatus> DisableAsync(Guid userKey, ISet<Guid> keys);
Task<UserOperationStatus> EnableAsync(Guid performingUserKey, ISet<Guid> keys);
Task<UserOperationStatus> EnableAsync(Guid userKey, ISet<Guid> keys);
Task<Attempt<UserUnlockResult, UserOperationStatus>> UnlockAsync(Guid performingUserKey, params Guid[] keys);
Task<Attempt<UserUnlockResult, UserOperationStatus>> UnlockAsync(Guid userKey, params Guid[] keys);
Task<Attempt<PasswordChangedModel, UserOperationStatus>> ChangePasswordAsync(Guid performingUserKey, ChangeUserPasswordModel model);
Task<Attempt<PasswordChangedModel, UserOperationStatus>> ChangePasswordAsync(Guid userKey, ChangeUserPasswordModel model);
Task<UserOperationStatus> ClearAvatarAsync(Guid userKey);
@@ -84,12 +84,14 @@ public interface IUserService : IMembershipUserService
/// <summary>
/// Gets all users that the requesting user is allowed to see.
/// </summary>
/// <param name="requestingUserKey">The Key of the user requesting the users.</param>
/// <returns></returns>
Task<Attempt<PagedModel<IUser>?, UserOperationStatus>> GetAllAsync(Guid requestingUserKey, int skip, int take) => throw new NotImplementedException();
/// <param name="userKey">The Key of the user requesting the users.</param>
/// <param name="skip">Amount to skip.</param>
/// <param name="take">Amount to take.</param>
/// <returns>All users that the user is allowed to see.</returns>
Task<Attempt<PagedModel<IUser>?, UserOperationStatus>> GetAllAsync(Guid userKey, int skip, int take) => throw new NotImplementedException();
public Task<Attempt<PagedModel<IUser>, UserOperationStatus>> FilterAsync(
Guid requestingUserKey,
Guid userKey,
UserFilter filter,
int skip = 0,
int take = 100,