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 <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
b25f3cbea0
commit
018f3142ec
@@ -9,16 +9,13 @@ function membershipAllowsRollCall(membership: {
|
|||||||
teamRole: string | null
|
teamRole: string | null
|
||||||
permissions: string[]
|
permissions: string[]
|
||||||
}): boolean {
|
}): boolean {
|
||||||
if (membership.isOwner) return true
|
if (membership.isOwner || membership.teamRole) return true
|
||||||
if (membership.teamRole === 'admin' || membership.teamRole === 'business_owner') {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return membership.permissions.includes('roll_calls.read')
|
return membership.permissions.includes('roll_calls.read')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show Roll Call when the business module is enabled and the user is
|
* 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(
|
export function canAccessRollCall(
|
||||||
user: AuthUser | null | undefined,
|
user: AuthUser | null | undefined,
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ function membershipAllowsRollCall(membership: {
|
|||||||
teamRole: string | null
|
teamRole: string | null
|
||||||
permissions: string[]
|
permissions: string[]
|
||||||
}): boolean {
|
}): boolean {
|
||||||
if (membership.isOwner) return true
|
if (membership.isOwner || membership.teamRole) return true
|
||||||
const role = membership.teamRole
|
|
||||||
if (role === 'admin' || role === 'business_owner' || role === 'owner') {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return membership.permissions.includes('roll_calls.read')
|
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
|
* 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(
|
export function canAccessRollCall(
|
||||||
user: AuthUser | null | undefined,
|
user: AuthUser | null | undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user