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 analytics.write scope

Steven Teya4966777b2ee
diff --git a/apps/web/app/api/track/lead/route.ts b/apps/web/app/api/track/lead/route.ts
index 1d2643d106..07ef34d70a 100644
--- a/apps/web/app/api/track/lead/route.ts
+++ b/apps/web/app/api/track/lead/route.ts
@@ -168,6 +168,5 @@ export const POST = withWorkspaceEdge(
"business max",
"enterprise",
],
- requiredPermissions: ["analytics.write"],
},
);
diff --git a/apps/web/app/api/track/sale/route.ts b/apps/web/app/api/track/sale/route.ts
index c082d37662..317dcbf93b 100644
--- a/apps/web/app/api/track/sale/route.ts
+++ b/apps/web/app/api/track/sale/route.ts
@@ -227,6 +227,5 @@ export const POST = withWorkspaceEdge(
"business max",
"enterprise",
],
- requiredPermissions: ["analytics.write"],
},
);
diff --git a/apps/web/lib/api/rbac/permissions.ts b/apps/web/lib/api/rbac/permissions.ts
index 32fa433de8..e05810f95b 100644
--- a/apps/web/lib/api/rbac/permissions.ts
+++ b/apps/web/lib/api/rbac/permissions.ts
@@ -12,7 +12,6 @@ export const PERMISSION_ACTIONS = [
"domains.write",
"tokens.read",
"tokens.write",
- "analytics.write",
"oauth_apps.read",
"oauth_apps.write",
"integrations.read",
@@ -73,11 +72,6 @@ export const ROLE_PERMISSIONS: {
description: "create, update, or delete tags",
roles: ["owner", "member"],
},
- {
- action: "analytics.write",
- description: "create analytics events",
- roles: ["owner", "member"],
- },
{
action: "tokens.read",
description: "access API keys",
diff --git a/apps/web/lib/api/tokens/scopes.ts b/apps/web/lib/api/tokens/scopes.ts
index e84de83333..091ba18660 100644
--- a/apps/web/lib/api/tokens/scopes.ts
+++ b/apps/web/lib/api/tokens/scopes.ts
@@ -8,7 +8,6 @@ export const SCOPES = [
"tags.read",
"tags.write",
"analytics.read",
- "analytics.write",
"domains.read",
"domains.write",
"workspaces.read",
@@ -92,13 +91,6 @@ export const RESOURCE_SCOPES: {
type: "read",
resource: "analytics",
},
- {
- scope: "analytics.write",
- roles: ["owner", "member"],
- permissions: ["analytics.write", "analytics.read"],
- type: "write",
- resource: "analytics",
- },
{
scope: "webhooks.read",
roles: ["owner", "member"],
@@ -137,7 +129,6 @@ export const RESOURCE_SCOPES: {
"workspaces.read",
"workspaces.write",
"analytics.read",
- "analytics.write",
],
},
];