isAllowed()) { $bundle = ProfileType::load($entity_bundle); if (!empty(array_filter($bundle->getRoles()))) { $result = AccessResult::allowedIf(!empty(array_intersect($account->getRoles(), $bundle->getRoles()))); } } return $result; } }