Exponential / Doc / Exponential Featured / Mugo.ca Blog: An introduction to fetching content in eZ Publish 4 and eZ Publish 5
Please Note: At the specific request of Ibexa, 7x is changing the project name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
Mugo.ca Blog: An introduction to fetching content in eZ Publish 4 and eZ Publish 5
Fetching content the new way on eZ Publish 5.x.
In the following article we are going to show you how to fetch information in the new eZ Publish version considering that permissions may be set in place on different sections and we will compare it to how is it done in the legacy kernel.
During the flow of this article we will introduce a new undocumented method which is going to let us bypass permissions set to different sections.
In our example, let's suppose that we are displaying a set of images in the media library. These images are displayed within the content structure tree, but aren't supposed to be directly accessible in the media library. Therefore, the anonymous user does not have permission to directly view those images and we need to bypass that permission limitation in our fetches.
Fetching content in eZ Publish legacy
Using the current user
This simple fetch will return a list of the images that we have, although if the anonymous user does not have permissions for that folder in the media library, we will get an empty result.
(In our eZ Publish legacy code examples, we are showing example template code. For eZ Publish 5, we are showing PHP code in a custom controller, since data fetches are now expected to be done in PHP land ...