userContext = $userContext; $this->entityManager = $entityManager; $this->bulkSummaryFactory = $bulkSummaryFactory; } /** * Check if content allowed for current user * * @param int $bulkUuid * @return bool */ public function isAllowed($bulkUuid) { /** @var BulkSummaryInterface $bulkSummary */ $bulkSummary = $this->entityManager->load( $this->bulkSummaryFactory->create(), $bulkUuid ); if ((int) $bulkSummary->getUserType() === UserContextInterface::USER_TYPE_INTEGRATION) { return true; } return ((int) $bulkSummary->getUserId()) === ((int) $this->userContext->getUserId()); } }