Add `isLockedOut` and `isActive` to `IIdentityUserRepository`.

pull/10501/head
maliming 4 years ago
parent 3d90cb8e8d
commit 4e169cedbb
No known key found for this signature in database
GPG Key ID: 096224957E51C89E

@ -33,19 +33,19 @@ namespace Volo.Abp.Identity
);
Task<IdentityUser> FindByNormalizedEmailAsync(
[NotNull] string normalizedEmail,
[NotNull] string normalizedEmail,
bool includeDetails = true,
CancellationToken cancellationToken = default
);
Task<List<IdentityUser>> GetListByClaimAsync(
Claim claim,
Claim claim,
bool includeDetails = false,
CancellationToken cancellationToken = default
);
Task<List<IdentityUser>> GetListByNormalizedRoleNameAsync(
string normalizedRoleName,
string normalizedRoleName,
bool includeDetails = false,
CancellationToken cancellationToken = default
);
@ -61,6 +61,8 @@ namespace Volo.Abp.Identity
string userName = null,
string phoneNumber = null,
string emailAddress = null,
bool? isLockedOut = null,
bool? isActive = null,
CancellationToken cancellationToken = default
);
@ -78,10 +80,10 @@ namespace Volo.Abp.Identity
Task<List<IdentityUser>> GetUsersInOrganizationUnitAsync(
Guid organizationUnitId,
CancellationToken cancellationToken = default
);
Task<List<IdentityUser>> GetUsersInOrganizationsListAsync(
List<Guid> organizationUnitIds,
CancellationToken cancellationToken = default
);
Task<List<IdentityUser>> GetUsersInOrganizationsListAsync(
List<Guid> organizationUnitIds,
CancellationToken cancellationToken = default
);
Task<List<IdentityUser>> GetUsersInOrganizationUnitWithChildrenAsync(
@ -96,6 +98,8 @@ namespace Volo.Abp.Identity
string userName = null,
string phoneNumber = null,
string emailAddress = null,
bool? isLockedOut = null,
bool? isActive = null,
CancellationToken cancellationToken = default
);
}

@ -141,6 +141,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
string userName = null,
string phoneNumber = null,
string emailAddress = null,
bool? isLockedOut = null,
bool? isActive = null,
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
@ -159,6 +161,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
.WhereIf(!string.IsNullOrWhiteSpace(userName), x => x.UserName == userName)
.WhereIf(!string.IsNullOrWhiteSpace(phoneNumber), x => x.PhoneNumber == phoneNumber)
.WhereIf(!string.IsNullOrWhiteSpace(emailAddress), x => x.Email == emailAddress)
.WhereIf(isLockedOut == true, x => x.LockoutEnabled && x.LockoutEnd > DateTimeOffset.UtcNow)
.WhereIf(isActive == true, x => x.IsActive == isActive)
.OrderBy(sorting.IsNullOrWhiteSpace() ? nameof(IdentityUser.UserName) : sorting)
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
@ -202,6 +206,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
string userName = null,
string phoneNumber = null,
string emailAddress = null,
bool? isLockedOut = null,
bool? isActive = null,
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
@ -219,6 +225,8 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
.WhereIf(!string.IsNullOrWhiteSpace(userName), x => x.UserName == userName)
.WhereIf(!string.IsNullOrWhiteSpace(phoneNumber), x => x.PhoneNumber == phoneNumber)
.WhereIf(!string.IsNullOrWhiteSpace(emailAddress), x => x.Email == emailAddress)
.WhereIf(isLockedOut == true, x => x.LockoutEnabled && x.LockoutEnd > DateTimeOffset.UtcNow)
.WhereIf(isActive == true, x => x.IsActive == isActive)
.LongCountAsync(GetCancellationToken(cancellationToken));
}

@ -143,6 +143,8 @@ namespace Volo.Abp.Identity.MongoDB
string userName = null,
string phoneNumber = null,
string emailAddress = null,
bool? isLockedOut = null,
bool? isActive = null,
CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken))
@ -160,6 +162,8 @@ namespace Volo.Abp.Identity.MongoDB
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(userName), x => x.UserName == userName)
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(phoneNumber), x => x.PhoneNumber == phoneNumber)
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(emailAddress), x => x.Email == emailAddress)
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(isLockedOut == true, x => x.LockoutEnabled && x.LockoutEnd > DateTimeOffset.UtcNow)
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(isActive == true, x => x.IsActive == isActive)
.OrderBy(sorting.IsNullOrWhiteSpace() ? nameof(IdentityUser.UserName) : sorting)
.As<IMongoQueryable<IdentityUser>>()
.PageBy<IdentityUser, IMongoQueryable<IdentityUser>>(skipCount, maxResultCount)
@ -210,6 +214,8 @@ namespace Volo.Abp.Identity.MongoDB
string userName = null,
string phoneNumber = null,
string emailAddress = null,
bool? isLockedOut = null,
bool? isActive = null,
CancellationToken cancellationToken = default)
{
return await (await GetMongoQueryableAsync(cancellationToken))
@ -227,6 +233,8 @@ namespace Volo.Abp.Identity.MongoDB
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(userName), x => x.UserName == userName)
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(phoneNumber), x => x.PhoneNumber == phoneNumber)
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(!string.IsNullOrWhiteSpace(emailAddress), x => x.Email == emailAddress)
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(isLockedOut == true, x => x.LockoutEnabled && x.LockoutEnd > DateTimeOffset.UtcNow)
.WhereIf<IdentityUser, IMongoQueryable<IdentityUser>>(isActive == true, x => x.IsActive == isActive)
.LongCountAsync(GetCancellationToken(cancellationToken));
}

Loading…
Cancel
Save