V14: Move towards get guid (#15889)
* Implement using keymap for member * Remove current usages of GetUserById * User userId resolver to resolve user key * Refactor user repository to use GUID not int * Add happy path test * Remove user in cache when user gets updated * Use await in async method * Fix up according to review * Update IMetricsConsentService.cs to have async method * Fix according to review * Fix more according to comments * Revert "Fix up according to review" This reverts commit a75acaaa * Get current backoffice user from method * Update user repository delete functionality * Fix up more test * Try to get user by id if key fails * Add user key as required claim * Fix tests * Don't set claim in BackofficeController * Create constant for the Sub claim --------- Co-authored-by: kjac <kja@umbraco.dk>
This commit is contained in:
@@ -32,7 +32,13 @@ public static class DistributedCacheExtensions
|
||||
=> dc.Refresh(UserCacheRefresher.UniqueId, userId);
|
||||
|
||||
public static void RefreshUserCache(this DistributedCache dc, IEnumerable<IUser> users)
|
||||
=> dc.Refresh(UserCacheRefresher.UniqueId, users.Select(x => x.Id).Distinct().ToArray());
|
||||
{
|
||||
foreach (IUser user in users)
|
||||
{
|
||||
dc.Refresh(UserCacheRefresher.UniqueId, user.Key);
|
||||
dc.Refresh(UserCacheRefresher.UniqueId, user.Id);
|
||||
}
|
||||
}
|
||||
|
||||
public static void RefreshAllUserCache(this DistributedCache dc)
|
||||
=> dc.RefreshAll(UserCacheRefresher.UniqueId);
|
||||
|
||||
Reference in New Issue
Block a user