public Task <BaseListResponseDto> FindCorpRoles(CommonCMDReq req) { var rsp = new BaseListResponseDto(); var rows = _queryCorpRepository.Get(a => a.CorporationKeyId == req.Identify.CorporationKeyId, a => a.CorpRoles).FirstOrDefault()?.CorpRoles.ToList(); rsp.Result = rows?.Select(a => new { roleName = a.Name, roleId = a.KeyId }).ToList(); rsp.OperateFlag = true; return(Task.FromResult(rsp)); }
public Task <BaseListResponseDto> FindEmployeePageBy(BasePagedRequestDto req) { var rsp = new BaseListResponseDto(); var rows = _queryEmployeeRepository.GetByPagination(a => !a.IsDelete && a.CorporationKeyId == req.Identify.CorporationKeyId, req.PageSize, req.PageIndex, null).ToList(); rsp.Result = rows; rsp.OperateFlag = true; return(Task.FromResult(rsp)); }
public Task <BaseListResponseDto> FindDomainPermissions(CommonCMDReq req) { BaseListResponseDto rsp = new BaseListResponseDto(); var rows = _querySubDomainRepository.Get(a => !a.IsDelete, b => b.SubDomainPermissions).ToList(); rsp.Result = rows.Select(a => new { keyId = a.KeyId, domainNmae = a.Name, action = a.SubDomainPermissions.Where(b => b.PermissionType == Domain.Auth.Entity.PermissionCategory.Action)?.GroupBy(b => b.GroupName, c => new { name = c.Name, no = c.No }).ToDictionary(b => b.Key, c => c), page = a.SubDomainPermissions.Where(b => b.PermissionType == Domain.Auth.Entity.PermissionCategory.Page)?.Select(c => new { name = c.Name, no = c.No }).ToList() }).ToList(); return(Task.FromResult(rsp)); }
public Task <BaseListResponseDto> QueryUserPermission(CommonCMDReq req) { var rsp = new BaseListResponseDto(); var rows = _queryEmployeeRepository.FindUserRolePermission(Guid.Parse(req.Identify.Token)); rsp.Result = new { pages = rows.Where(a => a.PermissionType == 1)?.Select(a => new { name = a.Name, no = a.No, }), actions = rows.Where(a => a.PermissionType == 2)?.Select(a => new { name = a.Name, no = a.No, }) }; rsp.OperateFlag = true; return(Task.FromResult(rsp)); }