storedObjectVoters as $storedObjectVoter) { if ($storedObjectVoter->supports($attributeAsEnum, $subject)) { $grant = $storedObjectVoter->voteOnAttribute($attributeAsEnum, $subject, $token); if (false === $grant) { $this->logger->debug(self::LOG_PREFIX.'deny access by storedObjectVoter', ['stored_object_voter' => $storedObjectVoter::class]); } return $grant; } } // 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; } }