mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Renamed SecureEntityChecker to SecureRequestedRightChecker
This commit is contained in:
parent
b47003bb52
commit
181872c41b
@ -9,7 +9,7 @@ use App\Domain\RightManagement\RightTransformerServiceInterface;
|
|||||||
/**
|
/**
|
||||||
* @author kevinfrantz
|
* @author kevinfrantz
|
||||||
*/
|
*/
|
||||||
final class SecureEntityChecker implements SecureEntityCheckerInterface
|
final class SecureRequestedRightChecker implements SecureRequestedRightCheckerInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var RightTransformerServiceInterface
|
* @var RightTransformerServiceInterface
|
@ -9,7 +9,7 @@ use App\Domain\RequestManagement\Right\RequestedRightInterface;
|
|||||||
*
|
*
|
||||||
* @author kevinfrantz
|
* @author kevinfrantz
|
||||||
*/
|
*/
|
||||||
interface SecureEntityCheckerInterface
|
interface SecureRequestedRightCheckerInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param RequestedRightInterface $requestedRight
|
* @param RequestedRightInterface $requestedRight
|
@ -9,10 +9,13 @@ use App\DBAL\Types\Meta\Right\CRUDType;
|
|||||||
use App\Entity\Meta\Right;
|
use App\Entity\Meta\Right;
|
||||||
use App\Domain\RequestManagement\Right\RequestedRight;
|
use App\Domain\RequestManagement\Right\RequestedRight;
|
||||||
use App\Domain\RequestManagement\Entity\RequestedEntityInterface;
|
use App\Domain\RequestManagement\Entity\RequestedEntityInterface;
|
||||||
use App\Domain\SecureManagement\SecureEntityChecker;
|
use App\Domain\SecureManagement\SecureRequestedRightChecker;
|
||||||
use App\Domain\RightManagement\RightTransformerService;
|
use App\Domain\RightManagement\RightTransformerService;
|
||||||
|
|
||||||
class SecureEntityCheckerTest extends TestCase
|
/**
|
||||||
|
* @author kevinfrantz
|
||||||
|
*/
|
||||||
|
class SecureRequestedRightCheckerTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testGranted(): void
|
public function testGranted(): void
|
||||||
{
|
{
|
||||||
@ -37,7 +40,7 @@ class SecureEntityCheckerTest extends TestCase
|
|||||||
$requestedEntity->method('getEntity')->willReturn($source);
|
$requestedEntity->method('getEntity')->willReturn($source);
|
||||||
$requestedRight->setRequestedEntity($requestedEntity);
|
$requestedRight->setRequestedEntity($requestedEntity);
|
||||||
$rightTransformerService = new RightTransformerService();
|
$rightTransformerService = new RightTransformerService();
|
||||||
$secureEntityChecker = new SecureEntityChecker($rightTransformerService);
|
$secureEntityChecker = new SecureRequestedRightChecker($rightTransformerService);
|
||||||
$result = $secureEntityChecker->check($requestedRight);
|
$result = $secureEntityChecker->check($requestedRight);
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
}
|
}
|
||||||
@ -65,7 +68,7 @@ class SecureEntityCheckerTest extends TestCase
|
|||||||
$requestedEntity->method('getEntity')->willReturn($source);
|
$requestedEntity->method('getEntity')->willReturn($source);
|
||||||
$requestedRight->setRequestedEntity($requestedEntity);
|
$requestedRight->setRequestedEntity($requestedEntity);
|
||||||
$rightTransformerService = new RightTransformerService();
|
$rightTransformerService = new RightTransformerService();
|
||||||
$secureEntityChecker = new SecureEntityChecker($rightTransformerService);
|
$secureEntityChecker = new SecureRequestedRightChecker($rightTransformerService);
|
||||||
$result = $secureEntityChecker->check($requestedRight);
|
$result = $secureEntityChecker->check($requestedRight);
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user