Browse Source
Update MongoIdentityUserRepository.cs
pull/21989/head
Mansur Besleney
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
6 deletions
-
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityUserRepository.cs
|
|
|
@ -449,6 +449,11 @@ public class MongoIdentityUserRepository : MongoDbRepository<IAbpIdentityMongoDb |
|
|
|
var upperFilter = filter?.ToUpperInvariant(); |
|
|
|
var query = await GetQueryableAsync(cancellationToken); |
|
|
|
|
|
|
|
if (id.HasValue) |
|
|
|
{ |
|
|
|
return query.Where(x => x.Id == id); |
|
|
|
} |
|
|
|
|
|
|
|
if (roleId.HasValue) |
|
|
|
{ |
|
|
|
var organizationUnitIds = (await GetQueryableAsync<OrganizationUnit>(cancellationToken)) |
|
|
|
@ -459,11 +464,6 @@ public class MongoIdentityUserRepository : MongoDbRepository<IAbpIdentityMongoDb |
|
|
|
query = query.Where(identityUser => identityUser.Roles.Any(x => x.RoleId == roleId.Value) || identityUser.OrganizationUnits.Any(x => organizationUnitIds.Contains(x.OrganizationUnitId))); |
|
|
|
} |
|
|
|
|
|
|
|
if (id.HasValue) |
|
|
|
{ |
|
|
|
return query.Where(x => x.Id == id); |
|
|
|
} |
|
|
|
|
|
|
|
return query |
|
|
|
.WhereIf( |
|
|
|
!filter.IsNullOrWhiteSpace(), |
|
|
|
@ -490,4 +490,4 @@ public class MongoIdentityUserRepository : MongoDbRepository<IAbpIdentityMongoDb |
|
|
|
.WhereIf(maxModifitionTime != null, p => p.LastModificationTime <= maxModifitionTime) |
|
|
|
.WhereIf(minModifitionTime != null, p => p.LastModificationTime >= minModifitionTime); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|