Start your All-Access Pass to unlock this challenge
Challenge 2 / 2
Our voter needs to know whether the target user - the one we're switching to - is an admin. We injected the Security service and wrote:
return !$this->security->isGrantedForUser($subject, 'ROLE_ADMIN');
Why not the more familiar $this->security->isGranted('ROLE_ADMIN')?
Skip challenges and go to theNext Chapter