fix: Getting an unauthorized error when accessing the workflow tab for a child-managed event (#24219)

* Update get.handler.ts

* fix: Ignore userIds form filter segment if no permission

* add tests

* Update booking-filters.e2e.ts

* Update booking-filters.e2e.ts

* fix test

* fix: got unautorized error when viewing workflows

* fix
This commit is contained in:
Anik Dhabal Babu
2025-10-02 13:38:21 +00:00
committed by GitHub
parent 96468c4083
commit 2f763dceda
@@ -51,17 +51,6 @@ export const getAllActiveWorkflowsHandler = async ({ input, ctx }: GetAllActiveW
if (!hasPermissionToViewWorkflows) throw new TRPCError({ code: "UNAUTHORIZED" });
}
if (eventType.parent?.teamId) {
const hasPermissionToViewWorkflows = await permissionCheckService.checkPermission({
userId: ctx.user.id,
teamId: eventType.parent?.teamId,
permission: "workflow.read",
fallbackRoles: [MembershipRole.ADMIN, MembershipRole.OWNER],
});
if (!hasPermissionToViewWorkflows) throw new TRPCError({ code: "UNAUTHORIZED" });
}
const allActiveWorkflows = await getAllWorkflowsFromEventType(
{
...completeEventType,