feat: allow only team users to record daily meetings (#8799)

This commit is contained in:
Jon@1599 2023-05-10 13:58:49 +05:30 committed by GitHub
parent cc3be0a6ac
commit 2e686d03fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import { z } from "zod";
import { handleErrorsJson } from "@calcom/lib/errors";
import { prisma } from "@calcom/prisma";
import type { GetRecordingsResponseSchema, GetAccessLinkResponseSchema } from "@calcom/prisma/zod-utils";
import { getRecordingsResponseSchema, getAccessLinkResponseSchema } from "@calcom/prisma/zod-utils";
import type { CalendarEvent } from "@calcom/types/Calendar";
@ -108,8 +109,17 @@ const DailyVideoApiAdapter = (): VideoApiAdapter => {
// added a 1 hour buffer for room expiration
const exp = Math.round(new Date(event.endTime).getTime() / 1000) + 60 * 60;
const { scale_plan: scalePlan } = await getDailyAppKeys();
if (scalePlan === "true") {
const hasTeamPlan = await prisma.membership.findFirst({
where: {
userId: event.organizer.id,
team: {
slug: {
not: null,
},
},
},
});
if (scalePlan === "true" && !!hasTeamPlan === true) {
return {
privacy: "public",
properties: {