feat: allow customizing of tracked change permissions - #1132
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements customizable tracked change permissions by introducing a permissionResolver hook that allows host applications to override default permission behavior for comment and tracked change operations.
- Adds a
permissionResolverfunction to SuperDoc configuration that can customize permission decisions - Updates permission checking logic throughout the codebase to use the new resolver system
- Integrates permission resolution into editor commands, toolbar states, and UI components
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/superdoc/src/dev/components/SuperdocDev.vue | Adds example permission resolver implementation and hardcoded user data for testing |
| packages/superdoc/src/core/types/index.js | Adds TypeScript definitions for the new permissionResolver function |
| packages/superdoc/src/core/collaboration/permissions.js | Updates isAllowed function to support custom permission resolvers with context |
| packages/superdoc/src/core/collaboration/collaboration.test.js | Adds comprehensive tests for the new permission resolver functionality |
| packages/superdoc/src/core/SuperDoc.js | Implements canPerformPermission method to centralize permission checking |
| packages/superdoc/src/components/CommentsLayer/CommentHeader.vue | Updates comment action buttons to use new permission context |
| packages/superdoc/src/components/CommentsLayer/CommentDialog.vue | Removes unused import of permissions module |
| packages/superdoc/src/SuperDoc.vue | Adds permissionResolver to editor options configuration |
| packages/super-editor/src/tests/toolbar/updateToolbarState.test.js | Adds mocks and tests for tracked change toolbar state management |
| packages/super-editor/src/tests/toolbar/super-toolbar-commands.test.js | Updates mocks to support new tracked change permission system |
| packages/super-editor/src/extensions/track-changes/track-changes.js | Integrates permission checks into track changes commands |
| packages/super-editor/src/extensions/track-changes/track-changes-extension.test.js | Adds tests for permission-based blocking of tracked change operations |
| packages/super-editor/src/extensions/track-changes/permission-helpers.test.js | Comprehensive tests for new permission helper functions |
| packages/super-editor/src/extensions/track-changes/permission-helpers.js | New module implementing tracked change collection and permission validation |
| packages/super-editor/src/core/Editor.js | Adds permissionResolver to editor options with TypeScript documentation |
| packages/super-editor/src/components/toolbar/super-toolbar.js | Updates toolbar to dynamically enable/disable tracked change buttons based on permissions |
| packages/super-editor/src/components/slash-menu/utils.js | Integrates tracked change context into slash menu system |
| packages/super-editor/src/components/slash-menu/tests/utils.test.js | Updates tests to handle new tracked change context |
| packages/super-editor/src/components/slash-menu/tests/testHelpers.js | Adds trackedChanges array to mock context |
| packages/super-editor/src/components/slash-menu/tests/menuItems.test.js | Adds tests for permission-based filtering of tracked change menu items |
| packages/super-editor/src/components/slash-menu/menuItems.js | Updates menu items to respect tracked change permissions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
harbournick
force-pushed
the
nick/sd-514-feature-add-user-level-attribute
branch
from
October 15, 2025 00:29
9777030 to
896f759
Compare
Contributor
|
🎉 This PR is included in version 0.25.0-next.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
superdocbot Bot
pushed a commit
that referenced
this pull request
Oct 15, 2025
# [0.25.0](v0.24.0...v0.25.0) (2025-10-15) ### Bug Fixes * replace (addition/deletion) tracked change bubble ([#1135](#1135)) ([cd8b480](cd8b480)) * toolbar font-size when multiple selected ([#1139](#1139)) ([234f8e1](234f8e1)) ### Features * allow customizing of tracked change permissions ([#1132](#1132)) ([1078801](1078801))
Contributor
|
🎉 This PR is included in version 0.25.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.