Optimized Facade

This commit is contained in:
Kevin Frantz 2018-10-31 22:57:56 +01:00
parent 7f9e4b6bc9
commit cf625f02a6
2 changed files with 6 additions and 4 deletions

View File

@ -6,10 +6,11 @@ use App\Entity\Attribut\IdAttributInterface;
use App\Entity\EntityInterface;
use App\Entity\Source\Attribut\GroupSourcesAttributInterface;
use App\Entity\Attribut\LawAttributInterface;
use App\Entity\Attribut\RelationAttributInterface;
/**
* @author kevinfrantz
*/
interface SourceInterface extends IdAttributInterface, EntityInterface, GroupSourcesAttributInterface, LawAttributInterface
interface SourceInterface extends IdAttributInterface, EntityInterface, GroupSourcesAttributInterface, LawAttributInterface, RelationAttributInterface
{
}

View File

@ -2,11 +2,12 @@
namespace App\Structur\Facade\Security\Source;
use App\Entity\NodeInterface;
use App\Entity\Source\SourceInterface;
use App\Entity\User;
use App\DBAL\Types\RightType;
use App\DBAL\Types\LayerType;
use App\Entity\Meta\RelationInterface;
use App\Entity\Meta\Relation;
/**
* @author kevinfrantz
@ -40,7 +41,7 @@ abstract class AbstractSourceFacade implements SourceFacadeInterface
throw \Exception("The id can't be changed!");
}
public function setNode(NodeInterface $node): void
public function setRelation(RelationInterface $relation): void
{
throw \Exception("The node can't be changed!");
}
@ -52,7 +53,7 @@ abstract class AbstractSourceFacade implements SourceFacadeInterface
}
}
public function getNode(): NodeInterface
public function getRelation(): Relation
{
if ($this->isGranted(RightType::READ, LayerType::NODE)) {
return $source->getNode();