Added comments

This commit is contained in:
Kevin Frantz
2019-01-18 18:12:31 +01:00
parent 727a5c2aaf
commit 4a40f78e7d
4 changed files with 45 additions and 0 deletions

View File

@@ -33,26 +33,47 @@ final class RightChecker implements RightCheckerInterface
return $allSourcesToWhichRightApplies;
}
/**
* @param SourceInterface $clientSource
*
* @return bool
*/
private function hasClientSource(SourceInterface $clientSource): bool
{
return $this->getAllSourcesToWhichRightApplies()->contains($clientSource);
}
/**
* @param string $layer
*
* @return bool
*/
private function isLayerEqual(string $layer): bool
{
return $this->right->getLayer() === $layer;
}
/**
* @param string $type
*
* @return bool
*/
private function isTypeEqual(string $type): bool
{
return $this->right->getCrud() === $type;
}
/**
* @return bool
*/
private function checkPermission(): bool
{
return $this->right->getGrant();
}
/**
* @param RightInterface $right
*/
public function __construct(RightInterface $right)
{
$this->right = $right;