mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #7278 from overleaf/jpa-block-track-changes-access
[web] block restricted token users from accessing track-changes details GitOrigin-RevId: f2e734b48aaa1d1cae6d5db0e0312a78d42165de
This commit is contained in:
parent
2401909919
commit
862ff734c6
3 changed files with 11 additions and 4 deletions
|
@ -664,12 +664,13 @@ App.directive(
|
|||
}
|
||||
|
||||
const initTrackChanges = function () {
|
||||
if (!trackChangesManager) return
|
||||
|
||||
trackChangesManager.rangesTracker = scope.sharejsDoc.ranges
|
||||
|
||||
// Force onChangeSession in order to set up highlights etc.
|
||||
trackChangesManager.onChangeSession()
|
||||
|
||||
if (!trackChangesManager) return
|
||||
editor.on('changeSelection', trackChangesManager.onChangeSelection)
|
||||
|
||||
// Selection also moves with updates elsewhere in the document
|
||||
|
|
|
@ -247,7 +247,9 @@ export default RangesTracker = class RangesTracker {
|
|||
this.applyDeleteToChanges(op, metadata)
|
||||
return this.applyDeleteToComments(op)
|
||||
} else if (op.c != null) {
|
||||
if (!window.isRestrictedTokenMember) {
|
||||
return this.addComment(op, metadata)
|
||||
}
|
||||
} else {
|
||||
throw new Error('unknown op type')
|
||||
}
|
||||
|
|
|
@ -475,13 +475,17 @@ export default App.controller(
|
|||
}
|
||||
|
||||
if ($scope.users[change.metadata.user_id] == null) {
|
||||
if (!window.isRestrictedTokenMember) {
|
||||
refreshChangeUsers(change.metadata.user_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rangesTracker.comments.length > 0) {
|
||||
if (!window.isRestrictedTokenMember) {
|
||||
ensureThreadsAreLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
for (const comment of Array.from(rangesTracker.comments)) {
|
||||
let new_comment
|
||||
|
|
Loading…
Reference in a new issue