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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user