Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

feat: Add ability to disable clone and copy for view links (#2983)

Ivan Starkovd1469f9e1df1
diff --git a/apps/builder/app/builder/builder.tsx b/apps/builder/app/builder/builder.tsx
index 4fe6cfb3a1..2f53da0a25 100644
--- a/apps/builder/app/builder/builder.tsx
+++ b/apps/builder/app/builder/builder.tsx
@@ -44,6 +44,7 @@ import {
$resources,
subscribeResources,
$marketplaceProduct,
+ $authTokenPermissions,
} from "~/shared/nano-states";
import { type Settings } from "./shared/client-settings";
import { getBuildUrl } from "~/shared/router-utils";
@@ -57,6 +58,8 @@ import { ProjectSettings } from "./features/project-settings";
import type { UserPlanFeatures } from "~/shared/db/user-plan-features.server";
import { $isCloneDialogOpen, $userPlanFeatures } from "./shared/nano-states";
import { CloneProjectDialog } from "~/shared/clone-project";
+import type { TokenPermissions } from "@webstudio-is/authorization-token";
+import { useToastErrors } from "~/shared/error/toast-error";
registerContainers();
@@ -228,6 +231,7 @@ export type BuilderProps = {
assets: [Asset["id"], Asset][];
authToken?: string;
authPermit: AuthPermit;
+ authTokenPermissions: TokenPermissions;
userPlanFeatures: UserPlanFeatures;
};
@@ -239,6 +243,7 @@ export const Builder = ({
authToken,
authPermit,
userPlanFeatures,
+ authTokenPermissions,
}: BuilderProps) => {
useMount(() => {
// additional data stores
@@ -247,6 +252,7 @@ export const Builder = ({
$authPermit.set(authPermit);
$authToken.set(authToken);
$userPlanFeatures.set(userPlanFeatures);
+ $authTokenPermissions.set(authTokenPermissions);
// set initial containers value
$assets.set(new Map(assets));
@@ -263,6 +269,7 @@ export const Builder = ({
$marketplaceProduct.set(build.marketplaceProduct);
});
+ useToastErrors();
useEffect(subscribeCommands, []);
useEffect(subscribeResources, []);
diff --git a/apps/builder/app/builder/features/topbar/menu/menu.tsx b/apps/builder/app/builder/features/topbar/menu/menu.tsx
index b8ace70e11..a6f8a7ae48 100644
--- a/apps/builder/app/builder/features/topbar/menu/menu.tsx
+++ b/apps/builder/app/builder/features/topbar/menu/menu.tsx
@@ -29,7 +29,7 @@ import {
} from "~/shared/theme";
import { useClientSettings } from "~/builder/shared/client-settings";
import { dashboardPath } from "~/shared/router-utils";
-import { $authPermit } from "~/shared/nano-states";
+import { $authPermit, $authTokenPermissions } from "~/shared/nano-states";
import { emitCommand } from "~/builder/shared/commands";
import { MenuButton } from "./menu-button";
import { $isProjectSettingsOpen } from "~/shared/nano-states/seo";
@@ -98,6 +98,7 @@ export const Menu = () => {
const [, setIsPublishOpen] = useIsPublishDialogOpen();
const { hasProPlan } = useStore($userPlanFeatures);
const authPermit = useStore($authPermit);
+ const authTokenPermission = useStore($authTokenPermissions);
const isPublishEnabled = authPermit === "own" || authPermit === "admin";
@@ -189,7 +190,11 @@ export const Menu = () => {
</DropdownMenuItemRightSlot>
</DropdownMenuItem>
- <Tooltip side="right" content={disabledShareTooltipContent}>
+ <Tooltip
+ side="right"
+ sideOffset={10}
+ content={disabledShareTooltipContent}
+ >
<DropdownMenuItem
onSelect={() => {
setIsShareOpen(true);
@@ -200,7 +205,11 @@ export const Menu = () => {
</DropdownMenuItem>
</Tooltip>
- <Tooltip side="right" content={disabledPublishTooltipContent}>
+ <Tooltip
+ side="right"
+ sideOffset={10}
+ content={disabledPublishTooltipContent}
+ >
<DropdownMenuItem
onSelect={() => {
setIsPublishOpen(true);
@@ -210,13 +219,26 @@ export const Menu = () => {
Publish
</DropdownMenuItem>
</Tooltip>
- <DropdownMenuItem
- onSelect={() => {
- $isCloneDialogOpen.set(true);
- }}
+
+ <Tooltip
+ side="right"
+ sideOffset={10}
+ content={
+ authTokenPermission.canClone === false
+ ? "Cloning has been disabled by the project owner"
+ : undefined
+ }
>
- Clone
- </DropdownMenuItem>
+ <DropdownMenuItem
+ onSelect={() => {
+ $isCloneDialogOpen.set(true);
+ }}
+ disabled={authTokenPermission.canClone === false}
+ >
+ Clone
+ </DropdownMenuItem>
+ </Tooltip>
+
<DropdownMenuSeparator />
<DropdownMenuItem
onSelect={() => {
diff --git a/apps/builder/app/routes/builder.$projectId.tsx b/apps/builder/app/routes/builder.$projectId.tsx
index 6cf1b38ed1..df34bc0a17 100644
--- a/apps/builder/app/routes/builder.$projectId.tsx
+++ b/apps/builder/app/routes/builder.$projectId.tsx
@@ -8,6 +8,8 @@ import { redirect, type LoaderArgs, json } from "@remix-run/node";
import { loadBuildByProjectId } from "@webstudio-is/project-build/index.server";
import { db as domainDb } from "@webstudio-is/domain/index.server";
import { db } from "@webstudio-is/project/index.server";
+import { db as authDb } from "@webstudio-is/authorization-token/index.server";
+
import {
AuthorizationError,
authorizeProject,
@@ -78,6 +80,17 @@ export const loader = async ({
const authToken = url.searchParams.get("authToken") ?? undefined;
+ const authTokenPermissions =
+ authPermit !== "own" && authToken !== undefined
+ ? await authDb.getTokenPermissions(
+ {
+ projectId: project.id,
+ token: authToken,
+ },
+ context
+ )
+ : authDb.tokenDefaultPermissions;
+
const { userPlanFeatures } = context;
if (userPlanFeatures === undefined) {
throw new Error("User plan features are not defined");
@@ -93,6 +106,7 @@ export const loader = async ({
build: devBuild,
assets: assets.map((asset) => [asset.id, asset]),
authToken,
+ authTokenPermissions,
authPermit,
userPlanFeatures,
};
diff --git a/apps/builder/app/shared/copy-paste/init-copy-paste.ts b/apps/builder/app/shared/copy-paste/init-copy-paste.ts
index 8494f79c32..de907345ed 100644
--- a/apps/builder/app/shared/copy-paste/init-copy-paste.ts
+++ b/apps/builder/app/shared/copy-paste/init-copy-paste.ts
@@ -1,3 +1,6 @@
+import { toastError } from "../error/toast-error";
+import { $authTokenPermissions } from "../nano-states";
+
const isValidClipboardEvent = (event: ClipboardEvent) => {
const selection = document.getSelection();
if (selection?.type === "Range") {
@@ -39,6 +42,12 @@ type Plugin = {
export const initCopyPaste = (plugins: Plugin[]) => {
const handleCopy = (event: ClipboardEvent) => {
+ if ($authTokenPermissions.get().canCopy === false) {
+ toastError("Copying has been disabled by the project owner");
+ event.preventDefault();
+ return;
+ }
+
if (
event.clipboardData === null ||
isValidClipboardEvent(event) === false
diff --git a/apps/builder/app/shared/error/toast-error.tsx b/apps/builder/app/shared/error/toast-error.tsx
new file mode 100644
index 0000000000..0a24cc936b
--- /dev/null
+++ b/apps/builder/app/shared/error/toast-error.tsx
@@ -0,0 +1,31 @@
+import { toast } from "@webstudio-is/design-system";
+import { useEffect } from "react";
+import { $toastErrors } from "../nano-states";
+
+let toastErrorsIndex = 0;
+
+/**
+ * To show errors exposed from the canvas | builder
+ */
+export const useToastErrors = () => {
+ useEffect(() => {
+ return $toastErrors.subscribe((toastErrors) => {
+ for (
+ let errorIndex = toastErrorsIndex;
+ errorIndex < toastErrors.length;
+ errorIndex++
+ ) {
+ toast.error(toastErrors[errorIndex]);
+ }
+
+ toastErrorsIndex = toastErrors.length;
+ });
+ }, []);
+};
+
+export const toastError = (error: string) => {
+ $toastErrors.set([
+ ...$toastErrors.get(),
+ "Copying has been disabled by the project owner",
+ ]);
+};
diff --git a/apps/builder/app/shared/nano-states/nano-states.ts b/apps/builder/app/shared/nano-states/nano-states.ts
index 92ce3565c0..e9e1c38b7c 100644
--- a/apps/builder/app/shared/nano-states/nano-states.ts
+++ b/apps/builder/app/shared/nano-states/nano-states.ts
@@ -28,6 +28,7 @@ import { $selectedPage } from "./pages";
import type { UnitSizes } from "~/builder/features/style-panel/shared/css-value-input/convert-units";
import type { Project } from "@webstudio-is/project";
import type { MarketplaceProduct } from "@webstudio-is/project-build";
+import type { TokenPermissions } from "@webstudio-is/authorization-token";
export const $project = atom<Project | undefined>();
@@ -301,9 +302,15 @@ export const $hoveredInstanceSelector = atom<undefined | InstanceSelector>(
export const $isPreviewMode = atom<boolean>(false);
export const $authPermit = atom<AuthPermit>("view");
+export const $authTokenPermissions = atom<TokenPermissions>({
+ canClone: true,
+ canCopy: true,
+});
export const $authToken = atom<string | undefined>(undefined);
+export const $toastErrors = atom<string[]>([]);
+
export type DragAndDropState = {
isDragging: boolean;
dropTarget?: ItemDropTarget;
diff --git a/apps/builder/app/shared/share-project/share-project-container.tsx b/apps/builder/app/shared/share-project/share-project-container.tsx
index e03b7c7762..b1ea5ac141 100644
--- a/apps/builder/app/shared/share-project/share-project-container.tsx
+++ b/apps/builder/app/shared/share-project/share-project-container.tsx
@@ -31,9 +31,7 @@ const useShareProjectContainer = (projectId: Project["id"]) => {
}
const updatedLink = {
projectId: projectId,
- token: link.token,
- relation: link.relation,
- name: link.name,
+ ...link,
};
const updatedLinks = links.map((currentLink) => {
if (currentLink.token === updatedLink.token) {
diff --git a/apps/builder/app/shared/share-project/share-project.stories.tsx b/apps/builder/app/shared/share-project/share-project.stories.tsx
index 85c31a072b..78ed5397a1 100644
--- a/apps/builder/app/shared/share-project/share-project.stories.tsx
+++ b/apps/builder/app/shared/share-project/share-project.stories.tsx
@@ -18,16 +18,22 @@ const initialLinks: Array<LinkOptions> = [
token: uuid(),
name: "View Only",
relation: "viewers",
+ canClone: false,
+ canCopy: false,
},
{
token: uuid(),
name: "View and Edit",
relation: "editors",
+ canClone: false,
+ canCopy: false,
},
{
token: uuid(),
name: "Build",
relation: "builders",
+ canClone: false,
+ canCopy: false,
},
];
@@ -56,6 +62,8 @@ const useShareProject = (
token: uuid(),
name: "Custom Link",
relation: "viewers",
+ canClone: false,
+ canCopy: false,
},
]);
};
diff --git a/apps/builder/app/shared/share-project/share-project.tsx b/apps/builder/app/shared/share-project/share-project.tsx
index ae1094d6d5..e930cb2538 100644
--- a/apps/builder/app/shared/share-project/share-project.tsx
+++ b/apps/builder/app/shared/share-project/share-project.tsx
@@ -21,6 +21,8 @@ import {
Link,
buttonStyle,
IconButton,
+ Checkbox,
+ Grid,
} from "@webstudio-is/design-system";
import {
CopyIcon,
@@ -81,27 +83,20 @@ const Permission = ({
};
type MenuProps = {
- relation: Relation;
name: string;
+ value: LinkOptions;
hasProPlan: boolean;
- onChangePermission: (relation: Relation) => void;
- onChangeName: (name: string) => void;
+ onChange: (value: LinkOptions) => void;
onDelete: () => void;
};
-const Menu = ({
- hasProPlan,
- relation,
- name,
- onChangePermission,
- onChangeName,
- onDelete,
-}: MenuProps) => {
+const Menu = ({ name, hasProPlan, value, onChange, onDelete }: MenuProps) => {
const [isOpen, setIsOpen] = useState(false);
const [customLinkName, setCustomLinkName] = useState<string>(name);
+
const handleCheckedChange = (relation: Relation) => (checked: boolean) => {
if (checked) {
- onChangePermission(relation);
+ onChange({ ...value, relation });
}
};
@@ -110,7 +105,7 @@ const Menu = ({
return;
}
- onChangeName(customLinkName);
+ onChange({ ...value, name: customLinkName });
setIsOpen(false);
};
@@ -142,7 +137,7 @@ const Menu = ({
saveCustomLinkName();
}
}}
- onBlur={() => onChangeName(customLinkName)}
+ onBlur={() => onChange({ ...value, name: customLinkName })}
placeholder="Share Project"
name="Name"
autoFocus
@@ -152,24 +147,80 @@ const Menu = ({
<Item>
<Label>Permissions</Label>
<Permission
- checked={relation === "viewers"}
+ checked={value.relation === "viewers"}
onCheckedChange={handleCheckedChange("viewers")}
title="View"
- info="Recipients can view, copy instances and clone the project"
+ //info="Recipients can view, copy instances and clone the project"
+ info={
+ <Flex direction="column">
+ Recipients can view, copy instances and clone the project.
+ {hasProPlan !== true && (
+ <>
+ <br />
+ <br />
+ Upgrade to a Pro account to set additional permissions.
+ <br /> <br />
+ <Link
+ className={buttonStyle({ color: "gradient" })}
+ color="contrast"
+ underline="none"
+ href="https://webstudio.is/pricing"
+ target="_blank"
+ >
+ Upgrade
+ </Link>
+ </>
+ )}
+ </Flex>
+ }
/>
- {/*
- Hide temporarily until we have a way to allow edit content but not edit tree, etc.
- <Permission
- onCheckedChange={handleCheckedChange("editors")}
- checked={relation === "editors"}
- title="Edit Content"
- info="Recipients can view the project and edit content like text and images, but they will not be able to change the styles or structure of your project."
- />
- */}
+ <Grid
+ css={{
+ ml: theme.spacing[6],
+ }}
+ >
+ <Grid
+ gap={1}
+ flow={"column"}
+ css={{
+ alignItems: "center",
+ justifyContent: "start",
+ }}
+ >
+ <Checkbox
+ disabled={hasProPlan !== true}
+ checked={value.canClone}
+ onCheckedChange={(canClone) => {
+ onChange({ ...value, canClone: Boolean(canClone) });
+ }}
+ id={`viewer-can-clone`}
+ />
+ <Label htmlFor={`viewer-can-clone`}>Can clone</Label>
+ </Grid>
+ <Grid
+ gap={1}
+ flow={"column"}
+ css={{
+ alignItems: "center",
+ justifyContent: "start",
+ }}
+ >
+ <Checkbox
+ disabled={hasProPlan !== true}
+ checked={value.canCopy}
+ onCheckedChange={(canCopy) => {
+ onChange({ ...value, canCopy: Boolean(canCopy) });
+ }}
+ id={`viewer-can-copy`}
+ />
+ <Label htmlFor={`viewer-can-copy`}>Can copy</Label>
+ </Grid>
+ </Grid>
+
<Permission
onCheckedChange={handleCheckedChange("builders")}
- checked={relation === "builders"}
+ checked={value.relation === "builders"}
title="Build"
info="Recipients can make any changes but can not publish the project."
/>
@@ -177,7 +228,7 @@ const Menu = ({
<Permission
disabled={hasProPlan !== true}
onCheckedChange={handleCheckedChange("administrators")}
- checked={relation === "administrators"}
+ checked={value.relation === "administrators"}
title="Admin"
info={
<Flex direction="column">
@@ -237,11 +288,13 @@ export type LinkOptions = {
token: string;
name: string;
relation: Relation;
+ canCopy: boolean;
+ canClone: boolean;
};
-type SharedLinkItemType = LinkOptions & {
- onChangeRelation: (permission: Relation) => void;
- onChangeName: (name: string) => void;
+type SharedLinkItemType = {
+ value: LinkOptions;
+ onChange: (value: LinkOptions) => void;
onDelete: () => void;
builderUrl: (props: {
authToken: string;
@@ -251,16 +304,13 @@ type SharedLinkItemType = LinkOptions & {
};
const SharedLinkItem = ({
- token,
- name,
- relation,
- onChangeRelation,
- onChangeName,
+ value,
+ onChange,
onDelete,
builderUrl,
hasProPlan,
}: SharedLinkItemType) => {
- const [currentName, setCurrentName] = useState(name);
+ const [currentName, setCurrentName] = useState(value.name);
const [isCopied, setIsCopied] = useState(false);
return (
@@ -280,8 +330,8 @@ const SharedLinkItem = ({
onClick={() => {
navigator.clipboard.writeText(
builderUrl({
- authToken: token,
- mode: relation === "viewers" ? "preview" : "edit",
+ authToken: value.token,
+ mode: value.relation === "viewers" ? "preview" : "edit",
})
);
setIsCopied(true);
@@ -292,11 +342,10 @@ const SharedLinkItem = ({
</Tooltip>
<Menu
name={currentName}
- relation={relation}
- onChangePermission={onChangeRelation}
- onChangeName={(name) => {
- setCurrentName(name);
- onChangeName(name);
+ value={value}
+ onChange={(value) => {
+ setCurrentName(value.name);
+ onChange(value);
}}
onDelete={onDelete}
hasProPlan={hasProPlan}
@@ -344,19 +393,14 @@ export const ShareProject = ({
const items = links.map((link) => (
<Fragment key={link.token}>
<SharedLinkItem
- onChangeRelation={(relation) => {
- onChange({ ...link, relation });
- }}
- onChangeName={(name) => {
- onChange({ ...link, name });
+ onChange={(value) => {
+ onChange(value);
}}
onDelete={() => {
onDelete(link);
}}
builderUrl={builderUrl}
- name={link.name}
- relation={link.relation}
- token={link.token}
+ value={link}
hasProPlan={hasProPlan}
/>
<Separator />
diff --git a/apps/builder/app/shared/sync/sync-stores.ts b/apps/builder/app/shared/sync/sync-stores.ts
index eacf65e55f..2a56749b64 100644
--- a/apps/builder/app/shared/sync/sync-stores.ts
+++ b/apps/builder/app/shared/sync/sync-stores.ts
@@ -24,6 +24,8 @@ import {
$selectedInstanceRenderState,
$hoveredInstanceSelector,
$isPreviewMode,
+ $authTokenPermissions,
+ $toastErrors,
synchronizedCanvasStores,
$synchronizedInstances,
$synchronizedBreakpoints,
@@ -108,6 +110,9 @@ export const registerContainers = () => {
);
clientStores.set("hoveredInstanceSelector", $hoveredInstanceSelector);
clientStores.set("isPreviewMode", $isPreviewMode);
+ clientStores.set("authTokenPermissions", $authTokenPermissions);
+ clientStores.set("toastErrors", $toastErrors);
+
clientStores.set("selectedStyleSources", $selectedStyleSources);
clientStores.set("selectedStyleState", $selectedStyleState);
clientStores.set("dragAndDropState", $dragAndDropState);
diff --git a/packages/authorization-token/src/db/authorization-token.ts b/packages/authorization-token/src/db/authorization-token.ts
index a43678d1f5..4edd94bd30 100644
--- a/packages/authorization-token/src/db/authorization-token.ts
+++ b/packages/authorization-token/src/db/authorization-token.ts
@@ -56,6 +56,43 @@ export const findMany = async (
return dbTokens;
};
+export const tokenDefaultPermissions = {
+ canClone: true,
+ canCopy: true,
+};
+
+export type TokenPermissions = typeof tokenDefaultPermissions;
+
+export const getTokenPermissions = async (
+ props: { projectId: Project["id"]; token: AuthorizationToken["token"] },
+ context: AppContext
+): Promise<TokenPermissions> => {
+ const dbToken = await prisma.authorizationToken.findUnique({
+ where: {
+ // eslint-disable-next-line camelcase
+ token_projectId: {
+ projectId: props.projectId,
+ token: props.token,
+ },
+ },
+ });
+
+ if (dbToken === null) {
+ throw new AuthorizationError("Authorization token not found");
+ }
+
+ switch (dbToken.relation) {
+ // canClone, canCopy permissions can be applied for viewers only
+ case "viewers":
+ return {
+ canClone: dbToken.canClone,
+ canCopy: dbToken.canCopy,
+ };
+ default:
+ return tokenDefaultPermissions;
+ }
+};
+
export const create = async (
props: {
projectId: Project["id"];
@@ -100,17 +137,14 @@ export const create = async (
};
export const update = async (
- props: {
- projectId: Project["id"];
- token: AuthorizationToken["token"];
- name: AuthorizationToken["name"];
- relation: AuthorizationToken["relation"];
- },
+ projectId: Project["id"],
+ props: Pick<AuthorizationToken, "token" | "relation"> &
+ Partial<AuthorizationToken>,
context: AppContext
) => {
// Only owner of the project can edit authorization tokens
const canCreateToken = await authorizeProject.hasProjectPermit(
- { projectId: props.projectId, permit: "own" },
+ { projectId, permit: "own" },
context
);
@@ -124,7 +158,7 @@ export const update = async (
where: {
// eslint-disable-next-line camelcase
token_projectId: {
- projectId: props.projectId,
+ projectId,
token: props.token,
},
},
@@ -136,7 +170,7 @@ export const update = async (
if (previousToken.relation !== props.relation) {
await authorizeAuthorizationToken.patchToken(
- { tokenId: props.token, projectId: props.projectId },
+ { tokenId: props.token, projectId },
previousToken.relation,
props.relation,
context
@@ -147,13 +181,15 @@ export const update = async (
where: {
// eslint-disable-next-line camelcase
token_projectId: {
- projectId: props.projectId,
+ projectId: projectId,
token: props.token,
},
},
data: {
name: props.name,
relation: props.relation,
+ canClone: props.canClone,
+ canCopy: props.canCopy,
},
});
diff --git a/packages/authorization-token/src/index.server.ts b/packages/authorization-token/src/index.server.ts
index 66cfba1293..e788c53f89 100644
--- a/packages/authorization-token/src/index.server.ts
+++ b/packages/authorization-token/src/index.server.ts
@@ -1,2 +1,2 @@
-export * as db from "./db";
+export { db } from "./db";
export * from "./trpc";
diff --git a/packages/authorization-token/src/index.ts b/packages/authorization-token/src/index.ts
index 61176b347e..6b8083cc40 100644
--- a/packages/authorization-token/src/index.ts
+++ b/packages/authorization-token/src/index.ts
@@ -1 +1,2 @@
export type { AuthorizationTokensRouter } from "./trpc";
+export type { TokenPermissions } from "./db/authorization-token";
diff --git a/packages/authorization-token/src/trpc/authorization-tokens-router.ts b/packages/authorization-token/src/trpc/authorization-tokens-router.ts
index d9ebfa3d86..2f3c845b8e 100644
--- a/packages/authorization-token/src/trpc/authorization-tokens-router.ts
+++ b/packages/authorization-token/src/trpc/authorization-tokens-router.ts
@@ -60,15 +60,19 @@ export const authorizationTokenRouter = router({
token: z.string(),
name: z.string(),
relation: TokenProjectRelation,
+ canClone: z.boolean(),
+ canCopy: z.boolean(),
})
)
.mutation(async ({ input, ctx }) => {
return await db.update(
+ input.projectId,
{
- projectId: input.projectId,
token: input.token,
name: input.name,
relation: input.relation,
+ canClone: input.canClone,
+ canCopy: input.canCopy,
},
ctx
);
diff --git a/packages/prisma-client/prisma/migrations/20240308131249_add-token-rights/migration.sql b/packages/prisma-client/prisma/migrations/20240308131249_add-token-rights/migration.sql
new file mode 100644
index 0000000000..d7ad4f8ede
--- /dev/null
+++ b/packages/prisma-client/prisma/migrations/20240308131249_add-token-rights/migration.sql
@@ -0,0 +1,3 @@
+-- AlterTable
+ALTER TABLE "AuthorizationToken" ADD COLUMN "canClone" BOOLEAN NOT NULL DEFAULT true,
+ADD COLUMN "canCopy" BOOLEAN NOT NULL DEFAULT true;
diff --git a/packages/prisma-client/prisma/schema.prisma b/packages/prisma-client/prisma/schema.prisma
index 8637fdda53..df70f04536 100644
--- a/packages/prisma-client/prisma/schema.prisma
+++ b/packages/prisma-client/prisma/schema.prisma
@@ -215,6 +215,9 @@ model AuthorizationToken {
relation AuthorizationRelation @default(viewers)
createdAt DateTime @default(now())
+ canClone Boolean @default(true)
+ canCopy Boolean @default(true)
+
@@id([token, projectId])
@@unique([token])
}