Skip to content

Commit b4cf93b

Browse files
carderneTrigger.dev RepoOps
authored andcommitted
fix(webapp): honor global flags for Logs access
Fix the Logs page redirecting to Tasks when Logs is visible in the sidebar. Mono-RevId: 139133a72d1e6174523e0c865475f5e0dbd9840b
1 parent 0d524fc commit b4cf93b

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
Fix the Logs page redirecting to Tasks when Logs is visible in the sidebar.

‎apps/webapp/app/services/logsAccess.server.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { prisma } from "~/db.server";
2-
import { FEATURE_FLAG, validateFeatureFlagValue } from "~/v3/featureFlags";
2+
import { resolveOrganizationFeatureFlags } from "~/v3/featureFlags.server";
33

44
export async function hasLogsPageAccess(
55
userId: string,
@@ -19,11 +19,10 @@ export async function hasLogsPageAccess(
1919
select: { featureFlags: true },
2020
});
2121

22-
if (!organization?.featureFlags) {
22+
if (!organization) {
2323
return false;
2424
}
2525

26-
const flags = organization.featureFlags as Record<string, unknown>;
27-
const result = validateFeatureFlagValue(FEATURE_FLAG.hasLogsPageAccess, flags.hasLogsPageAccess);
28-
return result.success && result.data === true;
26+
const flags = await resolveOrganizationFeatureFlags(organization.featureFlags);
27+
return flags.hasLogsPageAccess === true;
2928
}

0 commit comments

Comments
 (0)