src/AdminSections/AffiliatePortNetworkAdapters/AffiliatePortNetworkAdaptersVoter.php line 15

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace PPAdmin\AdminSections\AffiliatePortNetworkAdapters;
  3. use PlnaPenezenka\PPSDKBundle\Doctrine\Entity\Administrator;
  4. use PlnaPenezenka\PPSDKBundle\Doctrine\Entity\Common\DefaultEntity;
  5. use PlnaPenezenka\PPSDKBundle\Doctrine\Entity\Web;
  6. use PlnaPenezenka\PPSDKBundle\Service\AffiliatePortClient\Models\V1\Affiliate\AffiliatePortNetwork;
  7. use PlnaPenezenka\PPSDKBundle\Service\AffiliatePortClient\Models\V1\Affiliate\AffiliatePortNetworkAdapter;
  8. use PPAdmin\AdminSections\AdminSectionsList;
  9. use PPAdmin\Security\AbstractAdminGridSectionVoter;
  10. class AffiliatePortNetworkAdaptersVoter extends AbstractAdminGridSectionVoter
  11. {
  12.     public static function getSectionIdentifier(): string
  13.     {
  14.         return AdminSectionsList::AFFILIATE_PORT_NETWORK_ADAPTERS;
  15.     }
  16.     protected static function getSupportedSectionPermissions(): array
  17.     {
  18.         return [
  19.             self::SECTION_PERMISSION_ACCESS,
  20.             self::SECTION_PERMISSION_LIST,
  21.             self::SECTION_PERMISSION_VIEW_DETAIL
  22.         ];
  23.     }
  24.     function canViewSectionRecord(Administrator $adminAffiliatePortNetworkAdapter|DefaultEntity $record): bool
  25.     {
  26.         $current_web $this->webs_resolver->getCurrentManagedWeb();
  27.         return
  28.             $this->canAccessSection($admin$current_web) &&
  29.             $admin->hasPermission(static::getViewDetailPermission(), $current_web);
  30.     }
  31.     function canCreateSectionRecords(Administrator $adminWeb $web): bool
  32.     {
  33.         return false;
  34.     }
  35.     function canEditRecord(Administrator $adminAffiliatePortNetwork|DefaultEntity $record): bool
  36.     {
  37.         return false;
  38.     }
  39.     function canDeleteRecord(Administrator $adminAffiliatePortNetwork|DefaultEntity $record): bool
  40.     {
  41.         return false;
  42.     }
  43.     function canViewRecordAudit(Administrator $adminAffiliatePortNetwork|DefaultEntity $record): bool
  44.     {
  45.         return false;
  46.     }
  47. }