From 018f3142eccb0de8dbe75b2eeb52546c630bee92 Mon Sep 17 00:00:00 2001 From: Alireza Hassani Date: Sat, 10 Oct 2026 12:33:57 +0330 Subject: [PATCH] Show Roll Call to every staff role, including editors. Owners, admins, editors, and viewers can open it when the business module is enabled. Co-authored-by: Cursor --- apps/business/src/utils/rollCallAccess.ts | 7 ++----- apps/customer/src/utils/rollCallAccess.ts | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/apps/business/src/utils/rollCallAccess.ts b/apps/business/src/utils/rollCallAccess.ts index 7829dc8..db58a62 100644 --- a/apps/business/src/utils/rollCallAccess.ts +++ b/apps/business/src/utils/rollCallAccess.ts @@ -9,16 +9,13 @@ function membershipAllowsRollCall(membership: { teamRole: string | null permissions: string[] }): boolean { - if (membership.isOwner) return true - if (membership.teamRole === 'admin' || membership.teamRole === 'business_owner') { - return true - } + if (membership.isOwner || membership.teamRole) return true return membership.permissions.includes('roll_calls.read') } /** * Show Roll Call when the business module is enabled and the user is - * staff (owner / admin) for the active tenant. + * staff for the active tenant (owner, admin, editor, or viewer). */ export function canAccessRollCall( user: AuthUser | null | undefined, diff --git a/apps/customer/src/utils/rollCallAccess.ts b/apps/customer/src/utils/rollCallAccess.ts index 78d086e..cb586da 100644 --- a/apps/customer/src/utils/rollCallAccess.ts +++ b/apps/customer/src/utils/rollCallAccess.ts @@ -9,11 +9,7 @@ function membershipAllowsRollCall(membership: { teamRole: string | null permissions: string[] }): boolean { - if (membership.isOwner) return true - const role = membership.teamRole - if (role === 'admin' || role === 'business_owner' || role === 'owner') { - return true - } + if (membership.isOwner || membership.teamRole) return true return membership.permissions.includes('roll_calls.read') } @@ -24,7 +20,7 @@ function sameId(a: string | number | null | undefined, b: string | number | null /** * Show Roll Call when the business module is enabled and the user is - * staff (owner / admin) for the active tenant. + * staff for the active tenant (owner, admin, editor, or viewer). */ export function canAccessRollCall( user: AuthUser | null | undefined,