src/Platform/SecurityBundle/Entity/Access/SpecialPermissions.php line 13

Open in your IDE?
  1. <?php
  2. namespace Platform\SecurityBundle\Entity\Access;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Class SpecialPermissions
  6.  *
  7.  * @package Platform\SecurityBundle\Entity\Access
  8.  * @ORM\Embeddable
  9.  */
  10. class SpecialPermissions
  11. {
  12.     /**
  13.      * Tracks whether or not the account has "super user" abilities.
  14.      *
  15.      * @var bool
  16.      *
  17.      * @ORM\Column(
  18.      *  type = "boolean",
  19.      *  nullable = false
  20.      * )
  21.      */
  22.     protected $superUser false;
  23.     /**
  24.      * @return bool
  25.      */
  26.     public function isSuperUser(): bool
  27.     {
  28.         return ($this->superUser === true);
  29.     }
  30.     /**
  31.      * @return bool
  32.      */
  33.     public function canImpersonate(): bool
  34.     {
  35.         return $this->isSuperUser();
  36.     }
  37.     /**
  38.      * @param bool $value
  39.      * @return $this
  40.      */
  41.     public function setSuperUser($value)
  42.     {
  43.         $this->superUser = ($value === true);
  44.         return $this;
  45.     }
  46. }