Conversation
…nguage/locale operations (#34685) Backend portlet check used only PortletID.LANGUAGES while the UI (with default feature flag FEATURE_FLAG_LOCALES_HIDE_OLD_LANGUAGES_PORTLET=true) only exposes PortletID.LOCALES, causing permission denied for non-admin users; fix adds LOCALES as an accepted alternative at all 6 call sites using the existing OR logic in WebResource.InitBuilder. Refs: #34685 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
Contributor
|
Claude finished @dsilvam's task in 2m 5s —— View job dotCMS Backend Review
All four sub-agents returned NO_FINDINGS. The review comment has been updated. |
Contributor
|
✅ dotCMS Backend Review: no issues found. |
…or portlet assertions (#34685) Add getRequiredPortlets() to WebResource.InitBuilder to avoid brittle reflection in tests; update LanguagesResourceTest to use the compile-safe accessor instead of getDeclaredField. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dsolistorres
approved these changes
Apr 7, 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.
Summary
LanguagesResourcegated all write/sensitive operations onPortletID.LANGUAGES("languages"), but the UI only exposesPortletID.LOCALES("locales") to role assignments — making it impossible for non-admin users with the Locales portlet to add or edit locales.PortletID.LOCALESas a second accepted portlet at all 6 call sites inLanguagesResource(v2).WebResource.InitBuilder.requiredPortlet()already implements OR logic, so no framework changes were needed.Changes
dotCMS/src/main/java/com/dotcms/rest/api/v2/languages/LanguagesResource.java— 4 old-stylewebResource.init()calls converted toInitBuilderwith both portlet IDs; 2 existingInitBuildercalls updated to add the second portlet ID.dotCMS/src/test/java/v2/languages/LanguagesResourceTest.java— 4 new unit tests (one per write endpoint) that useArgumentCaptor+ reflection to assert both"languages"and"locales"are in the required portlet set.Test plan
./mvnw test -pl :dotcms-core -Dtest=LanguagesResourceTest— all 10 passRefs: #34685
🤖 Generated with Claude Code