0
samara081 created
4 Answer(s)
-
1
Hi @samara081
UserAppService has such a filter here https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/Authorization/Users/UserAppService.cs#L99, does that work for you ?
-
0
url give 404
-
1
https://github.com/aspnetzero/aspnet-zero-core repository is a private repository. You need to login first!
-
1
public async Task<PagedResultDto<UserListDto>> GetUsers(GetUsersInput input) { var query = UserManager.Users .WhereIf(input.Role.HasValue, u => u.Roles.Any(r => r.RoleId == input.Role.Value)) .WhereIf(input.OnlyLockedUsers, u => u.LockoutEndDateUtc.HasValue && u.LockoutEndDateUtc.Value > DateTime.UtcNow) .WhereIf( !input.Filter.IsNullOrWhiteSpace(), u => u.Name.Contains(input.Filter) || u.Surname.Contains(input.Filter) || u.UserName.Contains(input.Filter) || u.EmailAddress.Contains(input.Filter) ); // HERE IT CHECKS A SPECIFIC PERMISSION if (!input.Permission.IsNullOrWhiteSpace()) { query = from user in query join ur in _userRoleRepository.GetAll() on user.Id equals ur.UserId into urJoined from ur in urJoined.DefaultIfEmpty() join up in _userPermissionRepository.GetAll() on new { UserId = user.Id, Name = input.Permission } equals new { up.UserId, up.Name } into upJoined from up in upJoined.DefaultIfEmpty() join rp in _rolePermissionRepository.GetAll() on new { RoleId = ur == null ? 0 : ur.RoleId, Name = input.Permission } equals new { rp.RoleId, rp.Name } into rpJoined from rp in rpJoined.DefaultIfEmpty() where up != null && up.IsGranted || up == null && rp != null group user by user into userGrouped select userGrouped.Key; } // ... }