Hello.
I have a basic setup of API platform generated from api-platform/api-platform . I just removed greetings and added Product and ProductVariant entities and configured JWT token auth (https://api-platform.com/docs/core/jwt/).
There was some other bugs, but let's say it works fine.
Now I want to add Voter so I can do a custom permission checks. I created a Voter, tagged it in services.yaml and added proper annotations to an Entity and the app does call my voter.
But problem is that $subject variable always has NULL value. See following screenshots so you understand what I mean:


TL;DR
dump($subject) prints me NULL , always.
Is this bug or what?
Thanks in advance.
You have to pass the object in the access control like:
"access_control"="is_granted('ROLE_USER', object)"
Thanks Juan.
Will check when I get some time.
@JuanWilde Awesome. That's it.
Thanks Juan.
Most helpful comment
You have to pass the object in the access control like: