domma-cms 1.61.1 → 1.61.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/docs/cache.md +6 -0
  3. package/package.json +1 -1
  4. package/plugins/_lib/admin/mail/body-menu.js +1 -1
  5. package/plugins/_lib/admin/mail/cms-host.js +1 -1
  6. package/plugins/_lib/admin/mail/compose-window.js +1 -1
  7. package/plugins/_lib/admin/mail/contacts.js +1 -1
  8. package/plugins/_lib/admin/mail/diagnostics-section.js +1 -1
  9. package/plugins/_lib/admin/mail/drag-drop.js +1 -1
  10. package/plugins/_lib/admin/mail/folder-tree.js +1 -1
  11. package/plugins/_lib/admin/mail/font-controls.js +1 -1
  12. package/plugins/_lib/admin/mail/fonts.js +1 -1
  13. package/plugins/_lib/admin/mail/host-context.js +1 -1
  14. package/plugins/_lib/admin/mail/identity.js +1 -1
  15. package/plugins/_lib/admin/mail/image-senders-section.js +1 -1
  16. package/plugins/_lib/admin/mail/keyboard.js +1 -1
  17. package/plugins/_lib/admin/mail/mail.html +1 -1
  18. package/plugins/_lib/admin/mail/message-actions.js +1 -1
  19. package/plugins/_lib/admin/mail/oauth-panel.js +1 -1
  20. package/plugins/_lib/admin/mail/panes.js +1 -1
  21. package/plugins/_lib/admin/mail/reader-kit.js +1 -1
  22. package/plugins/_lib/admin/mail/reader-runtime.js +27 -1
  23. package/plugins/_lib/admin/mail/reader-view.js +1 -1
  24. package/plugins/_lib/admin/mail/resizable.js +1 -1
  25. package/plugins/_lib/admin/mail/restore-spam.js +1 -1
  26. package/plugins/_lib/admin/mail/rules.js +1 -1
  27. package/plugins/_lib/admin/mail/scheduling.js +1 -1
  28. package/plugins/_lib/admin/mail/section-kit.js +1 -1
  29. package/plugins/_lib/admin/mail/security-note.js +1 -1
  30. package/plugins/_lib/admin/mail/settings-section.js +1 -1
  31. package/plugins/_lib/admin/mail/templates.js +1 -1
  32. package/plugins/_lib/admin/mail/threads.js +1 -1
  33. package/plugins/_lib/admin/mail/vacation.js +1 -1
  34. package/plugins/_lib/admin/mail/when-closed.js +1 -1
  35. package/plugins/_lib/admin/ui/dates.js +1 -1
  36. package/plugins/_lib/admin/ui/resizable.js +1 -1
  37. package/plugins/_lib/domma-mail.lock.json +80 -80
  38. package/plugins/_lib/mail/accountFileStore.js +1 -1
  39. package/plugins/_lib/mail/accountRepository.js +1 -1
  40. package/plugins/_lib/mail/accountRoutes.js +1 -1
  41. package/plugins/_lib/mail/bodyTokenProvider.js +1 -1
  42. package/plugins/_lib/mail/bodyTokens.js +1 -1
  43. package/plugins/_lib/mail/compose.js +1 -1
  44. package/plugins/_lib/mail/defaults.js +1 -1
  45. package/plugins/_lib/mail/envelope.js +1 -1
  46. package/plugins/_lib/mail/folderActions.js +1 -1
  47. package/plugins/_lib/mail/folderRuntime.js +1 -1
  48. package/plugins/_lib/mail/folders.js +1 -1
  49. package/plugins/_lib/mail/imapPoolRuntime.js +1 -1
  50. package/plugins/_lib/mail/mbox.js +1 -1
  51. package/plugins/_lib/mail/message-action.js +1 -1
  52. package/plugins/_lib/mail/messageSecurity.js +1 -1
  53. package/plugins/_lib/mail/messageSecurityProvider.js +1 -1
  54. package/plugins/_lib/mail/networkAddresses.js +1 -1
  55. package/plugins/_lib/mail/networkPolicy.js +1 -1
  56. package/plugins/_lib/mail/oauthAccounts.js +1 -1
  57. package/plugins/_lib/mail/oauthRouteRuntime.js +1 -1
  58. package/plugins/_lib/mail/oauthRuntime.js +1 -1
  59. package/plugins/_lib/mail/pollSchedule.js +1 -1
  60. package/plugins/_lib/mail/poller.js +1 -1
  61. package/plugins/_lib/mail/pollerRuntime.js +1 -1
  62. package/plugins/_lib/mail/priority.js +1 -1
  63. package/plugins/_lib/mail/publicMailbox.js +1 -1
  64. package/plugins/_lib/mail/readRuntime.js +1 -1
  65. package/plugins/_lib/mail/render.js +1 -1
  66. package/plugins/_lib/mail/ruleRunner.js +1 -1
  67. package/plugins/_lib/mail/schedulerRuntime.js +1 -1
  68. package/plugins/_lib/mail/secretProvider.js +1 -1
  69. package/plugins/_lib/mail/secretbox.js +1 -1
  70. package/plugins/_lib/mail/senderAuth.js +1 -1
  71. package/plugins/_lib/mail/sieve.js +1 -1
  72. package/plugins/_lib/mail/smtpService.js +1 -1
  73. package/plugins/_lib/mail/snoozeRuntime.js +1 -1
  74. package/plugins/_lib/mail/store.js +1 -1
  75. package/plugins/_lib/mail/subscriptions.js +1 -1
  76. package/plugins/_lib/mail/syncPlan.js +1 -1
  77. package/plugins/_lib/mail/syncRuntime.js +1 -1
  78. package/plugins/_lib/mail/syncSelection.js +1 -1
  79. package/plugins/_lib/mail/unreadBadge.js +1 -1
  80. package/plugins/_lib/mail/unsubscribe.js +1 -1
  81. package/plugins/_lib/mail/vacationRuntime.js +1 -1
  82. package/plugins/_lib/mail/write.js +1 -1
  83. package/plugins/docs/CHANGELOG.md +5 -0
  84. package/plugins/docs/CLAUDE.md +30 -0
  85. package/plugins/docs/admin/views/docs.js +2 -1
  86. package/plugins/docs/admin/views/editor.js +5 -3
  87. package/plugins/docs/docs/guide.md +11 -0
  88. package/plugins/docs/lib/store.js +46 -2
  89. package/plugins/docs/plugin.js +70 -28
  90. package/plugins/docs/plugin.json +14 -1
  91. package/plugins/docs/tests/restricted.test.js +240 -0
  92. package/plugins/free-tier.lock.json +15 -13
  93. package/plugins/mail-reader/CLAUDE.md +6 -0
  94. package/plugins/mail-reader/plugin.js +9 -0
  95. package/plugins/mail-reader/plugin.json +1 -1
  96. package/server/services/publicAssets.js +55 -6
  97. package/server/templates/page.html +4 -7
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/folderActions.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/folderActions.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Whole-folder operations use a snapshot of UIDs, never the visible page or a moving '*'. */
4
4
  import {moveBulk, setFlagsBulk} from './write.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/folderRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/folderRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Portable folder operations. Hosts supply ownership, serialization and metadata updates. */
4
4
  import {validateFolderName, buildFolderPath, renameTarget, canModifyFolder, descendantsOf, moveTarget, resolveSubscriptions} from './folders.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/folders.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/folders.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {resolveSubscriptions} from './subscriptions.js';
4
4
  /**
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/imapPoolRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/imapPoolRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * IMAP connection pool for the Mail Reader plugin.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/mbox.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/mbox.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Exporting a folder as mbox.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/message-action.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/message-action.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Remember replies and forwards on the original message after delivery. */
4
4
  export const SOURCE_HEADER = 'X-Domma-Message-Source';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/messageSecurity.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/messageSecurity.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {createMessageSecurity} from './messageSecurityProvider.js';
4
4
  export const {setMessageSecurity, canProtect, protectRaw, protectDraftRaw, unwrapRaw, parseReadable} = createMessageSecurity();
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/messageSecurityProvider.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/messageSecurityProvider.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Where signing and encryption plug into the mail core.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/networkAddresses.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/networkAddresses.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Address classification from the CMS outbound policy, MIT licensed. */
4
4
  import net from 'node:net';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/networkPolicy.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/networkPolicy.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import dns from 'node:dns/promises';
4
4
  import net from 'node:net';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/oauthAccounts.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/oauthAccounts.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {randomUUID} from 'node:crypto';
4
4
  import {MailKeyError} from './secretProvider.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/oauthRouteRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/oauthRouteRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The OAuth2 sign-in routes for mailboxes: Connect, the provider's callback,
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/oauthRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/oauthRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * OAuth2 sign-in for mailboxes (XOAUTH2) - Microsoft 365 / Outlook.com and Gmail.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/pollSchedule.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/pollSchedule.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Deciding which mailboxes are due a poll.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/poller.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/poller.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Compatibility entry point for the shared mail poller. */
4
4
  export {createPoller} from './pollerRuntime.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/pollerRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/pollerRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The background poller.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/priority.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/priority.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * How urgent a sender said a message was.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/publicMailbox.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/publicMailbox.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Standalone mailbox summary. Explicit fields keep credentials out of responses. */
4
4
  export function publicMailbox(account) {
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/readRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/readRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {registerAccountRoutes} from './accountRoutes.js';
4
4
  import {ENVELOPE_QUERY, hasAttachment, parseHeaderBlock} from './envelope.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/render.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/render.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Message rendering for the Mail Reader plugin.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/ruleRunner.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/ruleRunner.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Carrying out what the rules decided.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/schedulerRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/schedulerRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The worker behind "send later", "undo send" and "snooze".
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/secretProvider.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/secretProvider.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {createCipheriv, createDecipheriv, createHash, randomBytes, scryptSync} from 'node:crypto';
4
4
  import fs from 'node:fs';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/secretbox.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/secretbox.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** CMS compatibility entry point. Standalone hosts create their own secret box. */
4
4
  import path from 'node:path';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/senderAuth.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/senderAuth.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Did this message really come from the address in its From line?
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/sieve.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/sieve.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** ManageSieve (RFC 5804). One bounded, TLS-verified session per operation. */
4
4
  import net from 'node:net';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/smtpService.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/smtpService.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Sending, and keeping a copy where the rest of your clients will find it.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/snoozeRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/snoozeRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {safeWritePool, moveMessage} from './write.js';
4
4
 
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/store.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/store.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The synchronised message store.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/subscriptions.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/subscriptions.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  export function resolveSubscriptions(boxes) {
4
4
  const list = boxes ?? [];
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/syncPlan.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/syncPlan.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Deciding what a folder sync needs to do.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/syncRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/syncRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {missingUids, planFolderSync} from './syncPlan.js';
4
4
  import {resolveSyncFolders} from './syncSelection.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/syncSelection.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/syncSelection.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Which folders a mailbox keeps mirrored.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/unreadBadge.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/unreadBadge.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The free reader's sidebar badge - unread mail in each mailbox's INBOX.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/unsubscribe.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/unsubscribe.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Getting off a mailing list.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/vacationRuntime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/vacationRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {randomUUID} from 'node:crypto';
4
4
  import {autoReplyHeaders, isActive, normaliseVacation, replySubject, shouldAutoReply, replyHistory} from '../admin/mail/vacation.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/mail/write.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/mail/write.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Changing mail, rather than reading it.
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## [2.15.0] - 2026-11-10
4
+ - **Own documents only** - a new permission, **Docs: own documents only** (`docs-restricted`), for roles that should write their own documents and nothing more: their own and shared documents only, whatever the site's "Who sees documents" setting says; no list of people and no sharing with anyone new; no public links; no emailing; nothing through other tools. Only Docs administrators see them in the list of people or can share with them. Enforced by the server on every route, and the screens hide what they cannot use. Nobody holds it unless a role is given it, so nothing changes on a site that does not use it. The Job Board gives it to companies and agents.
5
+ - For add-ons: `services.restrictedUser(user)`, and documents and settings answer `restrictedUser: true` for such a person.
@@ -322,3 +322,33 @@ by `inspectPdf`, text read, filed where the person may file, into their Recent).
322
322
  The version-history modal's cleanups (destroy after close, the context menu, the editor's refresh after a
323
323
  restore) listen with `modal.once('close', fn)` instead of the modal element's unprefixed `close` DOM event,
324
324
  which domma-js 0.58 removes. Same behaviour: once per close, whichever way it was closed.
325
+
326
+ ## Unreleased (2.15): restricted people - `docs-restricted`
327
+
328
+ A role holding the permission `docs-restricted` (declared in plugin.json, granted to nobody by Docs) keeps its holders
329
+ to their own documents and the ones shared with them. The Job Board grants it to its company and agent roles.
330
+
331
+ - **Who** (`lib/store.js`): `restrictedByRoles(roles, {isRoot, marked, givesDocs})` - pure: restricted when a role holds
332
+ it (`holdsRestriction`: the resource or any of its actions, from the role's RAW permissions) and no role that gives
333
+ `docs.read` lacks it (the CMS grants on the union of roles); a level-0 role never (it holds every permission, this
334
+ one included). plugin.js sets the live check with `setRestrictedCheck` (tests inject `options.isRestricted`);
335
+ `isRestricted(user)` - a throwing check restricts.
336
+ - **What** - all server-side: `accessOf` ignores `scope: 'all'`, admin rights and add-on access for them (own/shared
337
+ only, in every service and route through it); `onlyThroughExtension` is false; `isAdmin`/`services.isAdmin` false;
338
+ `GET /people` answers `[]`; `PUT .../shares` refuses (403) any change that names someone not already on the list -
339
+ checked BEFORE ids are looked up, so an unknown id and a real one get the same 403 (no account oracle); removals as before;
340
+ `POST .../link` and `POST .../send` 403; `full()` answers `publicLink: null`, `publicLinksAllowed: false`,
341
+ `restrictedUser: true`; `GET /settings` answers `publicLinks: false`, `allowSend: false`, `scope: 'user'`,
342
+ `restrictedUser: true`; `GET /folders`, `GET /templates`, `usableFolder` their own only; the PDF view ticket re-reads the
343
+ person (`{...viewer}`) so their roles decide. The extra keys appear ONLY for a restricted person - everyone else's
344
+ answers are byte-for-byte as before. NOT in `outwardRefusal`: Docs Pro's signing rule reads it, and signing their own
345
+ document through the registry must keep working.
346
+ - **Sharing** is closed to them rather than "by exact email": any answer to an address (the share list's names, a
347
+ notification) would tell them whether it has an account, and their flows (offer letters, agreements) need none.
348
+ Only Docs ADMINISTRATORS (level 0/1, not restricted) see restricted people in `GET /people` and may add them to a
349
+ share; for anyone else they are as unknown as an id that is no account (skipped). Otherwise every member with Docs
350
+ could list a Job Board's companies and email them through share notifications (review finding).
351
+ - Service `restrictedUser(user)` (Docs Pro wraps its `can` with it; the Job Board feature-detects it before granting).
352
+ - Admin: no Share (editor `canShare`, Home's row menu) and no Send to for them (`restrictedUser` on the document).
353
+ - Tests: `tests/restricted.test.js` (both scopes; the pure rule; the real check with no restricted role = unchanged).
354
+
@@ -519,7 +519,8 @@ export const docsView = {
519
519
  if (owner) items.push({label: 'Rename…', icon: 'edit-3', action: () => rename(id)});
520
520
  items.push({label: 'Make a copy', icon: 'copy', action: () => copy(id)});
521
521
  if (owner) items.push({label: 'Move to', icon: 'folder', submenu: moveItems(id)});
522
- if (editor && (owner || r.outward !== false)) items.push({label: 'Share…', icon: 'user-plus', action: () => share(id)});
522
+ // 2.15: a restricted person shares with nobody new, so no Share (the server refuses it too).
523
+ if (editor && (owner || r.outward !== false) && !site.restrictedUser) items.push({label: 'Share…', icon: 'user-plus', action: () => share(id)});
523
524
  items.push({label: 'Download', icon: 'download', submenu: r.format === 'pdf' ? pdfExportItems(fetchDoc(id)) : exportItems(fetchDoc(id))});
524
525
  if (editor && site.allowSend !== false && r.outward !== false) {
525
526
  items.push({label: 'Email…', icon: 'mail', action: async () => {
@@ -279,8 +279,9 @@ export const docsEditorView = {
279
279
  inTrash: M.computed(() => Boolean(current.value.trashedAt)),
280
280
  canRestore: M.computed(() => Boolean(current.value.trashedAt) && current.value.access === 'owner'),
281
281
  // 2.11: no Share for access that comes only through an add-on (the Wiki's editors).
282
+ // 2.15: none for a restricted person (own and shared documents only - the server refuses anyone new).
282
283
  canShare: M.computed(() => (current.value.access === 'owner' || current.value.access === 'editor') && !current.value.trashedAt
283
- && !(current.value.outwardRefusal && current.value.access !== 'owner')),
284
+ && !(current.value.outwardRefusal && current.value.access !== 'owner') && !current.value.restrictedUser),
284
285
  statsText: M.computed(() => {
285
286
  if (current.value.format === 'pdf') return [pdfFacts(current.value.file), current.value.file?.name].filter(Boolean).join(' · ') || 'PDF';
286
287
  const {words, chars} = stats.value;
@@ -769,7 +770,7 @@ export const docsEditorView = {
769
770
  const updated = await replacePdf(d, {session, host: pageEl});
770
771
  if (updated && !disposed) { const before = current.peek(); current.value = {...before, ...updated}; showContent({...updated, _before: before}); recount(); }
771
772
  }});
772
- if (rights && !d.outwardRefusal && site.allowSend !== false) {
773
+ if (rights && !d.outwardRefusal && !d.restrictedUser && site.allowSend !== false) {
773
774
  items.push({label: 'Send to', icon: 'send', submenu: [{label: 'Email…', icon: 'mail', action: () => openSendEmail({doc: d, kit, life: panelLife, publicLinksAllowed: site.publicLinks !== false})}]});
774
775
  }
775
776
  if (editorRights()) items.push({label: 'Version history', icon: 'clock', action: showHistory});
@@ -796,7 +797,8 @@ export const docsEditorView = {
796
797
  items.push({label: 'Download', icon: 'download', submenu: exportItems(snapshot)});
797
798
  items.push({label: 'Print or save as PDF…', icon: 'printer', action: () => exportItems(snapshot).at(-1).action()});
798
799
  // 2.11: nothing goes out of a document that may not leave Docs now (outwardRefusal).
799
- if (editorRights && !d.trashedAt && !d.outwardRefusal) {
800
+ // 2.15: a restricted person sends nothing out of Docs (email refused by the server; page and blog are not theirs).
801
+ if (editorRights && !d.trashedAt && !d.outwardRefusal && !d.restrictedUser) {
800
802
  items.push({label: 'Send to', icon: 'send', submenu: [
801
803
  ...(site.allowSend === false ? [] : [{label: 'Email…', icon: 'mail', action: async () => { const d = await snapshot(); if (!disposed) openSendEmail({doc: d, kit, life: panelLife, publicLinksAllowed: site.publicLinks !== false}); }}]),
802
804
  {label: 'A new page…', icon: 'file-text', action: async () => sendToPage(await snapshot())},
@@ -248,6 +248,17 @@ A PDF you add is a document in Docs that happens to be a file. Docs never change
248
248
 
249
249
  With the **Wiki** switched on, a document can be a wiki page (the owner adds it from its menu). People who edit the wiki can then edit the page here too, and see its history - but they cannot share it, give it a public link or send it, because they reach it through the wiki. While a wiki is for members only, nobody - its owner included - can share its pages with anyone new, link them publicly or send them. A page protected or locked in the Wiki shows a **Protected** chip and opens read only, for its owner too; hover the chip to see why.
250
250
 
251
+ ## Own documents only
252
+
253
+ A role can be limited to its own documents. Under **System > Roles**, the permission **Docs: own documents only** (with Docs' own permissions) gives its holders Docs for writing their own documents and working on ones shared with them - and nothing more:
254
+
255
+ - They see only their own documents and the ones shared with them, whatever **Who sees documents** says, and nothing through other tools (a Wiki).
256
+ - There is no list of people and no **Share** - they cannot share with anyone new. A Docs administrator can still share a document with them; other people do not see them in the list of people.
257
+ - No public links (not even the owner's link on a document shared with them), no **Send to** (email, page or blog).
258
+ - With **Docs Pro**: no Spaces, cloud copies, signing screens or protected links. Another tool may still send their own document for signing - the Job Board does, for offer letters and agreements.
259
+
260
+ It changes nothing for someone who also holds a role that gives Docs without it, nor for Super Admins. The Job Board gives it to its Company and Agent roles.
261
+
251
262
  ## Settings
252
263
 
253
264
  The cog on the banner opens **Docs settings**. **For everyone on this site** needs an administrator:
@@ -420,6 +420,46 @@ export async function readVersion(id, num) {
420
420
 
421
421
  // ------------------------------------------------------------------- access
422
422
 
423
+ /**
424
+ * Restricted people (2.15). A role holding the permission `docs-restricted` uses Docs for its own documents and
425
+ * the ones shared with it, and nothing else: no site-wide reading (`scope: 'all'`), no add-on access (a Wiki), no
426
+ * people list, no sharing with anyone new, no public links, no email from Docs, no publishing (Docs Pro). Decided
427
+ * from role DATA - the role editor shows it - never from role names.
428
+ *
429
+ * A person is restricted when one of their roles holds it and none of the roles that give them Docs lacks it (the
430
+ * CMS grants on the union of roles: a role that opens Docs fully opens it). A level-0 role is never restricted -
431
+ * it holds every permission, this one included.
432
+ */
433
+ export const RESTRICTED_PERMISSION = 'docs-restricted';
434
+
435
+ /**
436
+ * The rule, pure: the lookups are passed in.
437
+ *
438
+ * @param {string[]} roles - every role the person holds
439
+ * @param {{isRoot: (r: string) => boolean, marked: (r: string) => boolean, givesDocs: (r: string) => boolean}} look
440
+ * @returns {boolean}
441
+ */
442
+ export function restrictedByRoles(roles, {isRoot, marked, givesDocs}) {
443
+ const list = (Array.isArray(roles) ? roles : []).filter(r => typeof r === 'string' && r);
444
+ if (!list.length || list.some(isRoot)) return false;
445
+ if (!list.some(marked)) return false;
446
+ return !list.some(r => givesDocs(r) && !marked(r));
447
+ }
448
+
449
+ /** Does a role's permission list hold the restriction (the resource, or any action of it)? */
450
+ export function holdsRestriction(perms) {
451
+ return (Array.isArray(perms) ? perms : []).some(p => p === RESTRICTED_PERMISSION || String(p).startsWith(`${RESTRICTED_PERMISSION}.`));
452
+ }
453
+
454
+ let restrictedCheck = () => false;
455
+ /** plugin.js sets the check (it has the role lookups) before any route is up. */
456
+ export function setRestrictedCheck(fn) { restrictedCheck = typeof fn === 'function' ? fn : () => false; }
457
+ /** Is this person restricted? A check that throws restricts (fail closed). */
458
+ export function isRestricted(user) {
459
+ if (!user) return false;
460
+ try { return Boolean(restrictedCheck(user)); } catch { return true; }
461
+ }
462
+
423
463
  /**
424
464
  * What this user may do with a document.
425
465
  *
@@ -441,10 +481,14 @@ export function accessOf(doc, user, isAdmin = false) {
441
481
  if (!doc || !user) return null;
442
482
  if (doc.userId === user.id) return 'owner';
443
483
  const share = (doc.shares || []).find(s => s.userId === user.id);
444
- const siteWide = runtime.config.scope === 'all';
484
+ // 2.15: a restricted person has their own documents and those shared with them - never the site-wide
485
+ // setting's, an admin's or an add-on's (a Wiki's) access, whatever the site says.
486
+ const restricted = isRestricted(user);
487
+ const siteWide = runtime.config.scope === 'all' && !restricted;
445
488
  if (siteWide && isAdmin) return 'owner';
446
489
  const own = share ? (share.role === 'editor' ? 'editor' : share.role === 'suggester' ? 'suggester' : 'viewer')
447
490
  : siteWide ? 'viewer' : null;
491
+ if (restricted) return own;
448
492
  // An add-on may give more (2.11): the Wiki makes its editors editors of its pages.
449
493
  if (own === 'editor') return own;
450
494
  const extra = extensionAccess(doc, user);
@@ -484,7 +528,7 @@ export function extensionAccess(doc, user) {
484
528
  * with them.
485
529
  */
486
530
  export function onlyThroughExtension(doc, user) {
487
- if (!doc || !user || doc.userId === user.id || runtime.config.scope === 'all') return false;
531
+ if (!doc || !user || doc.userId === user.id || runtime.config.scope === 'all' || isRestricted(user)) return false;
488
532
  if ((doc.shares || []).some(s => s.userId === user.id)) return false;
489
533
  return Boolean(extensionAccess(doc, user));
490
534
  }