Start your All-Access Pass to unlock this challenge
Buy Access Login

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')?

Select your answer
Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.