mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 06:28:50 +00:00
feat: resolved identity filtering with blur
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user