storedObjectVoters as $storedObjectVoter) { if ($storedObjectVoter->supports($attributeAsEnum, $subject)) { return $storedObjectVoter->voteOnAttribute($attributeAsEnum, $subject, $token); } } // User role-based fallback if ($this->security->isGranted('ROLE_USER') || $this->security->isGranted('ROLE_ADMIN')) { // TODO: this maybe considered as a security issue, as all authenticated users can reach a stored object which // is potentially detached from an existing entity. return true; } return false; } }