I use cakephp 4 with authorization 2 plugin. I have a policy that check if the user have an "admin" role.
It works fine when a user is identified on the applica