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,