Fix: Include actor org id

This commit is contained in:
Daniel Hougaard
2024-03-12 15:44:44 +01:00
parent e89503f00f
commit 4aef8ab8ee

View File

@@ -37,8 +37,20 @@ export const secretBlindIndexServiceFactory = ({
return Number(secretCount);
};
const getProjectSecrets = async ({ projectId, actorId, actorAuthMethod, actor }: TGetProjectSecretsDTO) => {
const { hasRole } = await permissionService.getProjectPermission(actor, actorId, projectId, actorAuthMethod);
const getProjectSecrets = async ({
projectId,
actorId,
actorAuthMethod,
actorOrgId,
actor
}: TGetProjectSecretsDTO) => {
const { hasRole } = await permissionService.getProjectPermission(
actor,
actorId,
projectId,
actorAuthMethod,
actorOrgId
);
if (!hasRole(ProjectMembershipRole.Admin)) {
throw new UnauthorizedError({ message: "User must be admin" });
}