Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

remove requiredRole

Kiran K1581eccd41f2
diff --git a/apps/web/app/app.dub.co/(dashboard)/settings/tokens/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/settings/tokens/page-client.tsx
index ed137f5a47..0cd373b4d0 100644
--- a/apps/web/app/app.dub.co/(dashboard)/settings/tokens/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/settings/tokens/page-client.tsx
@@ -80,7 +80,7 @@ const TokenRow = (token: TokenProps) => {
const [openPopover, setOpenPopover] = useState(false);
const { DeleteTokenModal, setShowDeleteTokenModal } = useDeleteTokenModal({
- token
+ token,
});
return (
diff --git a/apps/web/lib/api/tokens/ratelimit.ts b/apps/web/lib/api/tokens/ratelimit.ts
index 35b00fe1ad..86e14ddffd 100644
--- a/apps/web/lib/api/tokens/ratelimit.ts
+++ b/apps/web/lib/api/tokens/ratelimit.ts
@@ -17,4 +17,4 @@ export const getRateLimitForPlan = (plan: PlanProps) => {
}
return 600;
-}
\ No newline at end of file
+};
diff --git a/apps/web/lib/auth/workspace-edge.ts b/apps/web/lib/auth/workspace-edge.ts
index 7e1994341a..baa8882e0c 100644
--- a/apps/web/lib/auth/workspace-edge.ts
+++ b/apps/web/lib/auth/workspace-edge.ts
@@ -49,7 +49,6 @@ export const withWorkspaceEdge = (
"business extra",
"enterprise",
], // if the action needs a specific plan
- requiredRole = ["owner", "member"],
needNotExceededClicks, // if the action needs the user to not have exceeded their clicks usage
needNotExceededLinks, // if the action needs the user to not have exceeded their links usage
needNotExceededAI, // if the action needs the user to not have exceeded their AI usage
@@ -58,7 +57,6 @@ export const withWorkspaceEdge = (
requiredScopes = [],
}: {
requiredPlan?: Array<PlanProps>;
- requiredRole?: Array<"owner" | "member">;
needNotExceededClicks?: boolean;
needNotExceededLinks?: boolean;
needNotExceededAI?: boolean;
@@ -290,15 +288,15 @@ export const withWorkspaceEdge = (
}
// workspace role checks
- if (
- !requiredRole.includes(workspace.users[0].role) &&
- !(allowSelf && searchParams.userId === session.user.id)
- ) {
- throw new DubApiError({
- code: "forbidden",
- message: "Unauthorized: Insufficient permissions.",
- });
- }
+ // if (
+ // !requiredRole.includes(workspace.users[0].role) &&
+ // !(allowSelf && searchParams.userId === session.user.id)
+ // ) {
+ // throw new DubApiError({
+ // code: "forbidden",
+ // message: "Unauthorized: Insufficient permissions.",
+ // });
+ // }
// clicks usage overage checks
if (needNotExceededClicks && workspace.usage > workspace.usageLimit) {
diff --git a/apps/web/lib/auth/workspace.ts b/apps/web/lib/auth/workspace.ts
index 2390ee7b44..4f0d02468d 100644
--- a/apps/web/lib/auth/workspace.ts
+++ b/apps/web/lib/auth/workspace.ts
@@ -70,7 +70,6 @@ export const withWorkspace = (
requiredScopes = [],
}: {
requiredPlan?: Array<PlanProps>;
- requiredRole?: Array<"owner" | "member">;
needNotExceededClicks?: boolean;
needNotExceededLinks?: boolean;
allowAnonymous?: boolean;
@@ -379,6 +378,8 @@ export const withWorkspace = (
}
}
+ console.log({ allowSelf });
+
// workspace role checks
// if (
// !requiredRole.includes(workspace.users[0].role) &&