EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

$options['data'] empty when using entryType

Open BaptisteChabrol opened this issue 8 months ago • 3 comments

Hello,

I'm using a CollectionField for my documents field in my CrudController, and I wanted to access $options['data'] to set the access granted for each document.

This method doesn't work because $options['data'] is empty. I've also tried applying the access with setPermission for each document, but it doesn't take a callback.

Am I doing this wrong, is there another way, or is it simply not possible?

I think I can try to do this by creating a custom template, but since I'm using the default CollectionField template, I'd like to avoid.

Thanks for your replies.

BaptisteChabrol avatar Apr 01 '25 13:04 BaptisteChabrol

I try to pass subject or object variable in the ->setPermission(new Expression("is_granted('" . <MYVOTER::CAN_EDIT> . "', subject)")), but I got a FieldDto and null value if I do $subject->getValue() in my Voter

BaptisteChabrol avatar Apr 04 '25 12:04 BaptisteChabrol

up

tsiatka avatar Apr 08 '25 12:04 tsiatka

up

BaptisteChabrol avatar Apr 29 '25 06:04 BaptisteChabrol