mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Added comments
This commit is contained in:
@@ -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;
|
||||
|
@@ -4,7 +4,17 @@ namespace App\Domain\RightManagement;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RightCheckerInterface
|
||||
{
|
||||
/**
|
||||
* @param string $layer
|
||||
* @param string $type
|
||||
* @param SourceInterface $source
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isGranted(string $layer, string $type, SourceInterface $source): bool;
|
||||
}
|
||||
|
Reference in New Issue
Block a user