Repository navigation
[2026.3][Class] Require objects permission for the custom layout editor collection route - #2079
Merged
Merged
Conversation
…or collection route The data object editor calls this read-only route whenever an object is opened. Requiring the classes permission made it return 403 for every user holding objects but not classes. View permission on the object and the user's allowed layouts are enforced in CustomLayoutService. Refs pimcore/platform-version#597 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The focused fix appears correct, but changing an authorization boundary warrants final maintainer security review.
Review effort: Balanced
Findings: None
What changed in this PR
Verdict: Request review. No blocking code issues found.
Restores data-object editor access to custom layouts for users without class-management permission.
Changes:
- Requires
DATA_OBJECTSfor the read-only editor collection route. - Adds a focused permission regression test.
- Retains
CLASS_DEFINITIONon administrative custom-layout routes.
Assessment:
- Fixes the root cause at the route authorization boundary; object-view and layout filtering remain enforced by the service.
- No missed call sites or backward-compatibility breaks found.
- Test coverage targets the narrowest relevant seam.
- No documentation or changelog update is included; remaining risk is the security-sensitive permission change requiring maintainer validation.
Findings
None.
| File | Description |
|---|---|
src/Class/Controller/CustomLayout/EditorCollectionController.php |
Restores DATA_OBJECTS authorization for editor layout discovery. |
tests/Unit/Class/Controller/CustomLayout/CustomLayoutControllerPermissionTest.php |
Separately verifies editor and administrative route permissions. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…collection The route only requires the objects permission, so cover that the service rejects users without view permission on the object and filters layouts for non-admin users. Refs pimcore/platform-version#597 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.




Resolves pimcore/platform-version#597
Problem
Since 2026.3.0, users with the
objectspermission but withoutclassesget a 403 onGET /class/custom-layout/editor/collection/{objectId}whenever they open a data object, so the editor shows repeated "no permission" dialogs.Cause
EditorCollectionControllerwas switched toCLASS_DEFINITIONtogether with the custom layout admin routes. It is not an admin route: the data object editor calls it on every object open to determine the available layouts.Fix
EditorCollectionControllerrequiresDATA_OBJECTSagain. This is safe because the route is read-only andCustomLayoutService::getCustomLayoutEditorCollection()already:getDataObjectElement(), which requires view permission on the object, andAll other custom layout controllers keep requiring
CLASS_DEFINITION.Tests
CustomLayoutControllerPermissionTest:EditorCollectionControllerremoved from theCLASS_DEFINITIONprovider and covered by a separateDATA_OBJECTSassertion; the other controllers are still asserted asCLASS_DEFINITION.classesvsobjects); the full Unit suite passes (1269 tests) after it.Notes
@internalcontroller changes; the response is unchanged.useCustomLayouts(studio-ui-bundle), which multiplies the dialogs.🤖 Generated with Claude Code