export type SpreadsheetAdminUserInfo = {
  role_id?: number;
  roles?: { id?: number };
} | null | undefined;

export function canManageSpreadsheetConfig(
  userInfo: SpreadsheetAdminUserInfo,
): boolean {
  const roleId = Number(userInfo?.role_id ?? userInfo?.roles?.id);
  return roleId === 1 || roleId === 2;
}
