feat: resolved identity filtering with blur

This commit is contained in:
=
2025-11-13 12:52:40 +05:30
parent 648489589b
commit 2e64f37a2d
3 changed files with 43 additions and 14 deletions
@@ -60,8 +60,14 @@ export const identityProjectServiceFactory = ({
});
const totalCount = await identityProjectDAL.getCountByProjectId(projectId, { search });
const filteredMemberships = identityMemberships.filter((el) =>
permission.can(
ProjectPermissionIdentityActions.Read,
subject(ProjectPermissionSub.Identity, { identityId: el.id })
)
);
return { identityMemberships, totalCount };
return { identityMemberships: filteredMemberships, totalCount };
};
const getProjectIdentityByIdentityId = async ({
@@ -299,7 +299,7 @@ export const membershipIdentityServiceFactory = ({
const { scopeData } = dto;
const factory = scopeFactory[scopeData.scope];
await factory.onListMembershipIdentityGuard(dto);
const listFilter = await factory.onListMembershipIdentityGuard(dto);
const memberships = await membershipIdentityDAL.findIdentities({
scopeData,
filter: {
@@ -317,7 +317,7 @@ export const membershipIdentityServiceFactory = ({
: undefined
}
});
return memberships;
return { ...memberships, data: memberships.data.filter((el) => listFilter({ identityId: el.identity.id })) };
};
const getMembershipByIdentityId = async (dto: TGetMembershipIdentityByIdentityIdDTO) => {