vendor/sulu/sulu/src/Sulu/Component/Security/Authorization/SecurityCondition.php line 17

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Sulu\Component\Security\Authorization;
  11. /**
  12.  * The class which describes the necessary permissions to access a certain element.
  13.  */
  14. class SecurityCondition
  15. {
  16.     /**
  17.      * The string representation of the security context.
  18.      *
  19.      * @var string
  20.      */
  21.     private $securityContext;
  22.     /**
  23.      * The type of the object which will be accessed, null if not a certain element but an area is accessed.
  24.      *
  25.      * @var string
  26.      */
  27.     private $objectType;
  28.     /**
  29.      * The id of the object which will be accessed, null if not a certain element but an area is accessed.
  30.      *
  31.      * @var mixed
  32.      */
  33.     private $objectId;
  34.     /**
  35.      * The locale in which the object or context will be accessed.
  36.      *
  37.      * @var string
  38.      */
  39.     private $locale;
  40.     /**
  41.      * The security system for which the permissions should be checked.
  42.      *
  43.      * @var string
  44.      */
  45.     private $system;
  46.     public function __construct($securityContext$locale null$objectType null$objectId null$system null)
  47.     {
  48.         $this->securityContext $securityContext;
  49.         $this->locale $locale;
  50.         $this->objectType $objectType;
  51.         $this->objectId $objectId;
  52.         $this->system $system;
  53.     }
  54.     /**
  55.      * Returns the string representation of a security context.
  56.      *
  57.      * @return string
  58.      */
  59.     public function getSecurityContext()
  60.     {
  61.         return $this->securityContext;
  62.     }
  63.     /**
  64.      * Returns the type of the object.
  65.      *
  66.      * @return string
  67.      */
  68.     public function getObjectType()
  69.     {
  70.         return $this->objectType;
  71.     }
  72.     /**
  73.      * Returns the id of the object.
  74.      */
  75.     public function getObjectId()
  76.     {
  77.         return $this->objectId;
  78.     }
  79.     /**
  80.      * Returns the locale in which the security has to be checked.
  81.      *
  82.      * @return string
  83.      */
  84.     public function getLocale()
  85.     {
  86.         return $this->locale;
  87.     }
  88.     /**
  89.      * @return string
  90.      */
  91.     public function getSystem()
  92.     {
  93.         return $this->system;
  94.     }
  95. }