Browse Source
Rename to `RemoveClaimFromAllUsersAsync `.
pull/19853/head
maliming
2 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
5 changed files with
5 additions and
5 deletions
-
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentityUserRepository.cs
-
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityClaimTypeManager.cs
-
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs
-
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityUserRepository.cs
-
modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/IdentityClaimTypeRepository_Tests.cs
|
|
|
@ -44,7 +44,7 @@ public interface IIdentityUserRepository : IBasicRepository<IdentityUser, Guid> |
|
|
|
CancellationToken cancellationToken = default |
|
|
|
); |
|
|
|
|
|
|
|
Task RemoveClaimFromAllUsers( |
|
|
|
Task RemoveClaimFromAllUsersAsync( |
|
|
|
string claimType, |
|
|
|
bool autoSave = false, |
|
|
|
CancellationToken cancellationToken = default |
|
|
|
|
|
|
|
@ -51,7 +51,7 @@ public class IdentityClaimTypeManager : DomainService |
|
|
|
} |
|
|
|
|
|
|
|
//Remove claim of this type from all users
|
|
|
|
await IdentityUserRepository.RemoveClaimFromAllUsers(claimType.Name); |
|
|
|
await IdentityUserRepository.RemoveClaimFromAllUsersAsync(claimType.Name); |
|
|
|
await IdentityClaimTypeRepository.DeleteAsync(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -145,7 +145,7 @@ public class EfCoreIdentityUserRepository : EfCoreRepository<IIdentityDbContext, |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task RemoveClaimFromAllUsers(string claimType, bool autoSave, CancellationToken cancellationToken = default) |
|
|
|
public virtual async Task RemoveClaimFromAllUsersAsync(string claimType, bool autoSave, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
var dbContext = await GetDbContextAsync(); |
|
|
|
var userClaims = await dbContext.Set<IdentityUserClaim>().Where(uc => uc.ClaimType == claimType).ToListAsync(cancellationToken: cancellationToken); |
|
|
|
|
|
|
|
@ -108,7 +108,7 @@ public class MongoIdentityUserRepository : MongoDbRepository<IAbpIdentityMongoDb |
|
|
|
.ToListAsync(GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task RemoveClaimFromAllUsers(string claimType, bool autoSave, CancellationToken cancellationToken = default) |
|
|
|
public virtual async Task RemoveClaimFromAllUsersAsync(string claimType, bool autoSave, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
var users = await (await GetMongoQueryableAsync(cancellationToken)) |
|
|
|
.Where(u => u.Claims.Any(c => c.ClaimType == claimType)) |
|
|
|
|
|
|
|
@ -80,7 +80,7 @@ public abstract class IdentityClaimTypeRepository_Tests<TStartupModule> : AbpIde |
|
|
|
} |
|
|
|
|
|
|
|
await ClaimTypeRepository.DeleteAsync(ageClaim.Id); |
|
|
|
await UserRepository.RemoveClaimFromAllUsers(ageClaim.Name); |
|
|
|
await UserRepository.RemoveClaimFromAllUsersAsync(ageClaim.Name); |
|
|
|
|
|
|
|
using (var uow = UnitOfWorkManager.Begin()) |
|
|
|
{ |
|
|
|
|