From 7cb6238f9299d4cb0a703091cccf9de3a02d6750 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Thu, 1 Nov 2018 18:39:53 +0100 Subject: [PATCH] Deleted unnecessary classes --- .../Security/Source/AbstractSourceFacade.php | 79 ------------ .../Security/Source/SourceFacadeInterface.php | 12 -- .../Security/Source/UserSourceFacade.php | 118 ------------------ 3 files changed, 209 deletions(-) delete mode 100644 application/src/Structur/Facade/Security/Source/AbstractSourceFacade.php delete mode 100644 application/src/Structur/Facade/Security/Source/SourceFacadeInterface.php delete mode 100644 application/src/Structur/Facade/Security/Source/UserSourceFacade.php diff --git a/application/src/Structur/Facade/Security/Source/AbstractSourceFacade.php b/application/src/Structur/Facade/Security/Source/AbstractSourceFacade.php deleted file mode 100644 index 2b8ab96..0000000 --- a/application/src/Structur/Facade/Security/Source/AbstractSourceFacade.php +++ /dev/null @@ -1,79 +0,0 @@ -source = $source; - } - - public function setId(int $id): void - { - throw \Exception("The id can't be changed!"); - } - - public function setRelation(RelationInterface $relation): void - { - throw \Exception("The node can't be changed!"); - } - - public function getId(): int - { - if ($this->isGranted(RightType::READ)) { - return $source->getId(); - } - } - - public function getRelation(): Relation - { - if ($this->isGranted(RightType::READ, LayerType::NODE)) { - return $source->getNode(); - } - } - - protected function isGranted(string $right, string $layer): bool - { - return $this->getNode() - ->getLaw() - ->isGranted(self::$user->getSource() - ->getNode(), self::$layer, $right); - } - - protected function lazyLoadSourceFacade(SourceInterface $source) - { - } - - public function __toString(): string - { - return $this->source->__toString(); - } -} diff --git a/application/src/Structur/Facade/Security/Source/SourceFacadeInterface.php b/application/src/Structur/Facade/Security/Source/SourceFacadeInterface.php deleted file mode 100644 index 5fff407..0000000 --- a/application/src/Structur/Facade/Security/Source/SourceFacadeInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -isNameSourceGranted(RightType::READ, LayerType::SOURCE)) { - // FILL! :) - } - } - - private function isNameSourceGranted(string $right, string $layer): bool - { - $nameSource = $this->source->getNameSource(); - $law = $nameSource->getNode()->getLaw(); - $userSourceNode = $this->source->getNode(); - - return $this->isGranted($right, $layer) && $law->isGranted($userSourceNode, $layer, $right); - } - - public function getUser(): UserInterface - { - } - - public function setUser(UserInterface $user): void - { - } - - public function getVersion(): int - { - /* - * - * @todo Implement - */ - } - - public function setVersion(int $version): void - { - /* - * - * @todo Implement - */ - } - - public function setSource(SourceInterface $source): void - { - /* - * - * @todo Implement - */ - } - - public function getGroupSources(): Collection - { - /* - * - * @todo Implement - */ - } - - public function getSource(): SourceInterface - { - /* - * - * @todo Implement - */ - } - - public function setGroupSources(Collection $groups): void - { - /* - * - * @todo Implement - */ - } - - public function setLaw(LawInterface $law): void - { - /* - * - * @todo Implement - */ - } - - public function getLaw(): LawInterface - { - /* - * - * @todo Implement - */ - } -}