src/Security/Voter/Permissions/User/UserOrganizationVoter.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Security\Voter\Permissions\User;
  3. use App\Manager\OrganizationManagerInterface;
  4. use App\Manager\UserManagerInterface;
  5. class UserOrganizationVoter extends UserVoter
  6. {
  7.     protected OrganizationManagerInterface $organizationManager;
  8.     public function __construct(OrganizationManagerInterface $organizationManagerUserManagerInterface $userManager)
  9.     {
  10.         parent::__construct($userManager);
  11.         $this->organizationManager $organizationManager;
  12.     }
  13.     protected function getEntities(string $userId)
  14.     {
  15.         list($organizations) = $this->organizationManager->getOrganizationsByUser($userId);
  16.         return $organizations;
  17.     }
  18. }