- Neos 8.3.3
i’m currently having a strange issue, that images are not rendered anymore after i’ve did some more media restrictions within my Policy.yaml. Basically i wanted to lock other users to work inside their specific Collection only.
I’ve started to develop a project without, by having all images inside “All”. Used that assets in my content elements and never faced any issue in frontend.
Now i’ve created a Collection, moved all the pictures from that project inside and did the following in my Policy.yaml:
[...] privilegeTargets: 'Neos\Flow\Security\Authorization\Privilege\Entity\Doctrine\EntityPrivilege': 'Vendor.Project:Site.Vendor': matcher: 'isType("Neos\Neos\Domain\Model\Site") && property("nodeName") == "vendor-project"' [...] 'Neos\Media\Security\Authorization\Privilege\ReadAssetPrivilege': 'Vendor.Project:HideAllOtherCollections': matcher: 'isWithoutCollection()' 'Vendor.Project:ReadAllPDFs': matcher: 'hasMediaType("application/pdf")' 'Vendor.Project:ReadAllPngs': matcher: 'hasMediaType("image/png")' 'Vendor.Project:ReadAllJpgs': matcher: 'hasMediaType("image/jpeg")' 'Vendor.Project:ReadAllGifs': matcher: 'hasMediaType("image/gif")' " 'Vendor.Project:P03.ReadAllFiles': matcher: 'isInCollection("MyCollection")' [...] 'Neos\Media\Security\Authorization\Privilege\ReadAssetCollectionPrivilege': 'Vendor.Project:P03.ReadAssetCollection': matcher: 'hasId("47fd792d-b43b-4d0a-8573-6ddae018a85c")' [...] 'Neos.Neos:P03': privileges: - # Grant "backend users" to access the "Member area" privilegeTarget: 'Vendor.Project:Site.Vendor' permission: GRANT - # Is giving access to read specific asset collection privilegeTarget: 'Vendor.Project:P03.ReadAssetCollection' permission: GRANT - # Is giving acces to read specific asset collection privilegeTarget: 'Vendor.Project:P03.ReadAllFiles' permission: GRANT - # Is giving access to read all png files privilegeTarget: 'Vendor.Project:ReadAllPngs' permission: GRANT - # Negate default deny, and gives access to jpg/jpeg files privilegeTarget: 'Vendor.Project:ReadAllJpgs' permission: GRANT - # Negate default deny, and gives access to pdf files privilegeTarget: 'Vendor.Project:ReadAllPDFs' permission: GRANT [...]
But now my images in frontend are empty:
<img src="" srcset=" 1920w, 1680w, 1366w, 1024w, 960w, 768w, 614w, 380w, 280w" alt="" aria-label="" loading="lazy" class="wb-aspect-ratio__target">
In the backend i can see them and when i’m moving out from backend to show the preview, they are also loaded without any issues:
Was the change in Policy.yaml causing that? If yes, how can i prevent that my frontend is affected with that? Or was there any other mistake i’ve did?
/e: Deleting the Neos_Session cookie will prevent the image from loading
/e: Giving the same permissions as Neos.Neos:P03 to Neos.Flow:Anonymous is loading the images.