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. * @param string $securityContext
  18. * @param string $objectType
  19. * @param mixed $objectId
  20. * @param string $locale
  21. * @param string $system
  22. */
  23. public function __construct(
  24. /**
  25. * The string representation of the security context.
  26. */
  27. private $securityContext,
  28. /**
  29. * The locale in which the object or context will be accessed.
  30. */
  31. private $locale = null,
  32. /**
  33. * The type of the object which will be accessed, null if not a certain element but an area is accessed.
  34. */
  35. private $objectType = null,
  36. /**
  37. * The id of the object which will be accessed, null if not a certain element but an area is accessed.
  38. */
  39. private $objectId = null,
  40. /**
  41. * The security system for which the permissions should be checked.
  42. */
  43. private $system = null
  44. ) {
  45. }
  46. /**
  47. * Returns the string representation of a security context.
  48. *
  49. * @return string
  50. */
  51. public function getSecurityContext()
  52. {
  53. return $this->securityContext;
  54. }
  55. /**
  56. * Returns the type of the object.
  57. *
  58. * @return string
  59. */
  60. public function getObjectType()
  61. {
  62. return $this->objectType;
  63. }
  64. /**
  65. * Returns the id of the object.
  66. */
  67. public function getObjectId()
  68. {
  69. return $this->objectId;
  70. }
  71. /**
  72. * Returns the locale in which the security has to be checked.
  73. *
  74. * @return string
  75. */
  76. public function getLocale()
  77. {
  78. return $this->locale;
  79. }
  80. /**
  81. * @return string
  82. */
  83. public function getSystem()
  84. {
  85. return $this->system;
  86. }
  87. }