Add global and profile-scoped activity log views with server-side actor enrichment, admin sidebar access for ADMIN/Super Admin roles, collapsible user detail sections, and horizontally scrollable account activity tables. Co-authored-by: Cursor <cursoragent@cursor.com>
19 lines
525 B
TypeScript
19 lines
525 B
TypeScript
const ACTIVITY_LOG_BYPASS_TEAM_ROLES = new Set(["SUPER_ADMIN", "ADMIN"])
|
|
|
|
export function getSessionTeamRole(): string {
|
|
return localStorage.getItem("role")?.trim() ?? ""
|
|
}
|
|
|
|
export function hasActivityLogRoleBypass(): boolean {
|
|
const role = getSessionTeamRole().toUpperCase()
|
|
return ACTIVITY_LOG_BYPASS_TEAM_ROLES.has(role)
|
|
}
|
|
|
|
export function hasActivityLogPermission(
|
|
permission: string,
|
|
permissions: string[],
|
|
): boolean {
|
|
if (hasActivityLogRoleBypass()) return true
|
|
return permissions.includes(permission)
|
|
}
|