New Backoffice: Fix feedback to users controller (#14031)

* Add specific not found results

* Add tests for the enable/disable not found tweak

* Cache ids and key in UserIdKeyResolver

* Don't cache null keys

* BackOffice not Backoffice

* Move fetching the user out of the ChangePasswordUsersController

* Move resolving user out of SetAvatar

* Move resolving user out of Update

* Return more specific notfound in bykey

* Use ErrorResult for all endpoints with unknown errors

* Split integration tests

* Add mappers

* Use ?: consistently

* Add reuseable iso code validator

* Validate ISO code

* Update supressions

* Use method from base to get current user key

* Rename ISo to Iso

* Use keys in services instead of user groups + Added a couple of new validations

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Mole
2023-04-04 15:41:12 +02:00
committed by GitHub
parent 6313b8b3a1
commit 21b0a7ffae
61 changed files with 731 additions and 364 deletions

View File

@@ -0,0 +1,21 @@
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Services.OperationStatus;
namespace Umbraco.Cms.Core.Security;
public interface ICoreBackOfficeUserManager
{
Task<IdentityCreationResult> CreateAsync(UserCreateModel createModel);
/// <summary>
/// Creates a user for an invite. This means that the password will not be populated with
/// </summary>
/// <param name="createModel"></param>
/// <returns></returns>
Task<IdentityCreationResult> CreateForInvite(UserCreateModel createModel);
Task<Attempt<string, UserOperationStatus>> GenerateEmailConfirmationTokenAsync(IUser user);
Task<Attempt<UserUnlockResult, UserOperationStatus>> UnlockUser(IUser user);
}