> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Users 集合

`User` 表示 Overleaf 系统中的单个用户账户。它存储身份验证数据、功能标志、编辑器偏好、访问权限以及活动元数据。

#### 核心身份与身份验证

* `_id`：用户的唯一 MongoDB ObjectId。
* `email` / `emails`：主邮箱及历史邮箱记录。
* `hashedPassword`：用于本地身份验证的 BCrypt 哈希密码。
* `first_name` / `last_name`：用户资料中的姓名字段。
* `role` / `isAdmin` / `adminRoles`：角色及管理权限标志。
* `twoFactorAuthentication`：双因素身份验证配置（如已启用）。
* `samlIdentifiers` / `thirdPartyIdentifiers`：外部身份提供商绑定。

#### 账户状态与生命周期

* `signUpDate`：账户创建时间戳。
* `holdingAccount`：账户是否处于待确认或受限状态。
* `must_reconfirm`：表示用户是否必须重新确认邮箱。
* `lastPrimaryEmailCheck`：上次验证主邮箱的时间。

#### 登录与活动跟踪

* `lastLoginIp`：上次成功登录的 IP 地址。
* `loginCount`：成功登录的总次数。
* `loginEpoch`：登录会话的内部计数器。
* `lastLoggedIn`：上次登录的时间戳。
* `lastActive`：上次记录到活动的时间戳。
* `lastFailedLogin`：上次登录失败的时间戳。

#### 编辑器偏好（`ace`）

定义用户在在线编辑器中的偏好：

* `theme` / `overallTheme`：编辑器和界面主题。
* `fontSize`：编辑器字体大小。
* `autoComplete`、`autoPairDelimiters`：编辑辅助功能。
* `spellCheckLanguage`：拼写检查所用语言。
* `pdfViewer`：所选的 PDF 查看器后端。
* `syntaxValidation`、`mathPreview`、`breadcrumbs`：编辑器用户体验功能。
* `enableNewEditor`：是否启用新版编辑器界面。

#### 功能标志与限制（`features`）

控制用户可用的功能：

* `collaborators`：协作者数量上限（`-1` = 无限制）。
* `versioning`、`trackChanges`：历史记录和修订跟踪功能。
* `dropbox`、`github`、`gitBridge`：外部集成的可用性。
* `compileTimeout`：最长编译时间（秒）。
* `compileGroup`：分配的编译资源组。
* `aiErrorAssistant`：基于 AI 的编译错误助手标志。

#### 访问控制与员工权限（`staffAccess`）

定义细粒度的员工或出版商访问权限：

* 面向出版商、机构、群组、管理员和实验的指标及管理权限。

#### 注册与集成

* `enrollment.sso`：已关联的 SSO 注册。
* `refProviders`：参考文献提供商集成。
* `writefull`：Writefull 写作助手账户状态。
* `dsMobileApp`：移动应用配置（如有）。

#### 计划与实验

* `alphaProgram` / `betaProgram` / `labsProgram`：是否参与抢先体验计划。
* `labsExperiments`：已启用的实验性功能。
* `awareOfV2`：用户是否已知晓 V2 编辑器。

#### 推荐与教程

* `referal_id`、`refered_users`、`refered_user_count`：推荐跟踪。
* `completedTutorials`：入门引导和功能教程的完成进度。

***

以下是一个 Overleaf 用户的真实示例。

<Accordion title="用户示例">
  ```json5 theme={null}
  {
      _id: ObjectId('69661f10432ad80d8a7de39d'),
      enrollment: {
          sso: []
      },
      staffAccess: {
          publisherMetrics: false,
          publisherManagement: false,
          institutionMetrics: false,
          institutionManagement: false,
          groupMetrics: false,
          groupManagement: false,
          adminMetrics: false,
          splitTestMetrics: false,
          splitTestManagement: false
      },
      ace: {
          mode: 'none',
          theme: 'textmate',
          overallTheme: 'light-',
          fontSize: 12,
          autoComplete: true,
          autoPairDelimiters: true,
          spellCheckLanguage: 'en',
          pdfViewer: 'pdfjs',
          mathPreview: true,
          breadcrumbs: true,
          referencesSearchMode: 'advanced',
          syntaxValidation: true,
          enableNewEditor: false
      },
      features: {
          collaborators: -1,
          versioning: true,
          dropbox: true,
          github: true,
          gitBridge: true,
          compileTimeout: 180,
          compileGroup: 'standard',
          references: true,
          trackChanges: true,
          aiErrorAssistant: false
      },
      refProviders: {},
      writefull: {
          enabled: null,
          autoCreatedAccount: false,
          isPremium: false,
          premiumSource: null
      },
      aiErrorAssistant: {
          enabled: true
      },
      overleaf: {},
      twoFactorAuthentication: {},
      dsMobileApp: {},
      email: 'admin@overleaf.com',
      first_name: 'admin',
      role: '',
      institution: '',
      isAdmin: true,
      adminRoles: [],
      lastLoginIp: '172.19.0.2',
      loginCount: 14,
      holdingAccount: false,
      must_reconfirm: false,
      refered_users: [],
      refered_user_count: 0,
      alphaProgram: false,
      betaProgram: false,
      labsProgram: false,
      labsExperiments: [],
      awareOfV2: false,
      samlIdentifiers: [],
      thirdPartyIdentifiers: [],
      emails: [
          {
              email: 'admin@overleaf.com',
              createdAt: ISODate('2026-01-15T07:53:24.276Z'),
              reversedHostname: 'moc.faelrevo'
          }
      ],
      signUpDate: ISODate('2026-01-13T10:31:44.786Z'),
      featuresOverrides: [],
      referal_id: 'ncbyrxrr6rrfQzgp',
      __v: 0,
      hashedPassword: '$2a$12$bkfRN7zw27mwaFpUbnSsC.naeFoMAwoRxU0qk7dlPH2obhj8jx.lK',
      loginEpoch: 18,
      lastLoggedIn: ISODate('2026-01-19T05:09:01.075Z'),
      lastActive: ISODate('2026-01-19T05:06:43.145Z'),
      last_name: 'user',
      lastPrimaryEmailCheck: ISODate('2026-01-15T07:53:24.283Z'),
      featuresUpdatedAt: ISODate('2026-01-15T07:53:24.305Z'),
      completedTutorials: {
          'ide-redesign-beta-intro': {
              state: 'completed',
              updatedAt: ISODate('2026-01-18T10:55:18.095Z')
          }
      },
      lastFailedLogin: ISODate('2026-01-19T05:08:53.241Z')
  }
  ```
</Accordion>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.