-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent duplicate content scopes in UserPermissionsService.getContentScopes
#2929
base: main
Are you sure you want to change the base?
Prevent duplicate content scopes in UserPermissionsService.getContentScopes
#2929
Conversation
Quality Gate passedIssues Measures |
This is a known bug, but for couriosity, what does this bug affect in real life? I see some problems here:
|
Could we port the relevant changes to this PR? |
The chips in the user permissions admin panel show incorrect numbers. |
"@comet/cms-api": patch | ||
--- | ||
|
||
Fix a Bug that results in duplicate ContentScopes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix a Bug that results in duplicate ContentScopes | |
Prevent duplicate content scopes in `UserPermissionsService.getContentScopes` |
.map((cs) => JSON.stringify(cs)) | ||
.filter((value, index, self) => self.indexOf(value) === index) | ||
.map((cs) => JSON.parse(cs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer using uniqWith and isEqual instead.
UserPermissionsService.getContentScopes
Description
The getContentScopes method returns duplicate Scopes
Acceptance criteria
Further information