mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 22:27:22 +00:00
Update identity-project-service.ts
This commit is contained in:
@@ -380,6 +380,12 @@ export const identityProjectServiceFactory = ({
|
|||||||
}: TGetProjectIdentityByMembershipIdDTO) => {
|
}: TGetProjectIdentityByMembershipIdDTO) => {
|
||||||
const membership = await identityProjectDAL.findOne({ id: identityMembershipId });
|
const membership = await identityProjectDAL.findOne({ id: identityMembershipId });
|
||||||
|
|
||||||
|
if (!membership) {
|
||||||
|
throw new NotFoundError({
|
||||||
|
message: `Project membership with ID '${identityMembershipId}' not found`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const { permission } = await permissionService.getProjectPermission({
|
const { permission } = await permissionService.getProjectPermission({
|
||||||
actor,
|
actor,
|
||||||
actorId,
|
actorId,
|
||||||
@@ -389,12 +395,6 @@ export const identityProjectServiceFactory = ({
|
|||||||
actionProjectType: ActionProjectType.Any
|
actionProjectType: ActionProjectType.Any
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!membership) {
|
|
||||||
throw new NotFoundError({
|
|
||||||
message: `Project membership with ID '${identityMembershipId}' not found`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
ForbiddenError.from(permission).throwUnlessCan(
|
ForbiddenError.from(permission).throwUnlessCan(
|
||||||
ProjectPermissionIdentityActions.Read,
|
ProjectPermissionIdentityActions.Read,
|
||||||
subject(ProjectPermissionSub.Identity, { identityId: membership.identityId })
|
subject(ProjectPermissionSub.Identity, { identityId: membership.identityId })
|
||||||
|
|||||||
Reference in New Issue
Block a user