Extract scope comparison into contentScopesAreEqual - #6150
Merged
Conversation
FilesService and the files controller injected ContentScopeService only to compare two scopes, so the DAM depends on the user-permissions layer for a check that needs no state. FoldersService ran the same comparison inline via lodash.isequal. Move the comparison into contentScopesAreEqual. The DAM call sites and ContentScopeService.scopesAreEqual, which now delegates to it, share one implementation, and the DAM services no longer inject ContentScopeService. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
VPS-thodax
marked this pull request as ready for review
August 9, 2026 19:56
This was referenced Aug 9, 2026
kaufmo
approved these changes
Aug 10, 2026
VPS-Obi
approved these changes
Aug 10, 2026
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.
Problem
FilesServiceand the DAM files controller injectedContentScopeServiceonly to call itsscopesAreEqualmethod — a stateless deep comparison. That ties the DAM to the user-permissions layer for a check that needs no state.FoldersServiceran the same comparison inline vialodash.isequal, so the rule existed twice.Solution
The comparison lives in
contentScopesAreEqualnow, next to theContentScopeinterface inuser-permissions/:ContentScopeService.scopesAreEqualdelegates to it, so its callers are unaffected.ContentScopeService.No changeset because
contentScopesAreEqualis internal andContentScopeService.scopesAreEqualkeeps its signature, so the public API is unchanged.Verification
content-scopes-are-equal.spec.tscover a class instance against a plain object plus differing values, differing keys andundefinedscopesOutlook
First of three stacked pull requests that let
DamFilesModulebe registered withoutUserPermissionsModule: #6151 splitsDamModuleinto sub-modules, #6153 makes the DAM's scope-based access control optional.