ファイル
btrc-hub/frontend/src/lib/users.ts
T
2026-06-03 07:25:24 +09:00

8 行
271 B
TypeScript

import type { User, UserRole } from '@/types'
const CONTENT_EDITOR_ROLES: readonly UserRole[] = ['admin', 'member']
export const canEditContent = (
user: Pick<User, 'role'> | null | undefined,
): boolean => user != null && CONTENT_EDITOR_ROLES.includes (user.role)