src/AdminSections/AffiliatePortNetworks/AffiliatePortNetworksVoter.php line 14

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace PPAdmin\AdminSections\AffiliatePortNetworks;
  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 PPAdmin\AdminSections\AdminSectionsList;
  8. use PPAdmin\Security\AbstractAdminGridSectionVoter;
  9. class AffiliatePortNetworksVoter extends AbstractAdminGridSectionVoter
  10. {
  11.     public static function getSectionIdentifier(): string
  12.     {
  13.         return AdminSectionsList::AFFILIATE_PORT_NETWORKS;
  14.     }
  15.     protected static function getSupportedSectionPermissions(): array
  16.     {
  17.         return [
  18.             self::SECTION_PERMISSION_ACCESS,
  19.             self::SECTION_PERMISSION_LIST,
  20.             self::SECTION_PERMISSION_VIEW_DETAIL
  21.         ];
  22.     }
  23.     function canViewSectionRecord(Administrator $adminAffiliatePortNetwork|DefaultEntity $record): bool
  24.     {
  25.         $current_web $this->webs_resolver->getCurrentManagedWeb();
  26.         return
  27.             $this->canAccessSection($admin$current_web) &&
  28.             $admin->hasPermission(static::getViewDetailPermission(), $current_web);
  29.     }
  30.     function canCreateSectionRecords(Administrator $adminWeb $web): bool
  31.     {
  32.         return false;
  33.     }
  34.     function canEditRecord(Administrator $adminAffiliatePortNetwork|DefaultEntity $record): bool
  35.     {
  36.         return false;
  37.     }
  38.     function canDeleteRecord(Administrator $adminAffiliatePortNetwork|DefaultEntity $record): bool
  39.     {
  40.         return false;
  41.     }
  42.     function canViewRecordAudit(Administrator $adminAffiliatePortNetwork|DefaultEntity $record): bool
  43.     {
  44.         return false;
  45.     }
  46. }