Implemented standart rights for user sources

This commit is contained in:
Kevin Frantz
2019-03-31 19:18:11 +02:00
parent a11296df5b
commit 70a117c927
4 changed files with 62 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ use Infinito\Domain\RequestManagement\Entity\RequestedEntityServiceInterface;
use Infinito\Exception\NotCorrectInstanceException;
use Infinito\DBAL\Types\Meta\Right\LayerType;
use Infinito\Domain\LayerManagement\LayerInterfaceMap;
use FOS\UserBundle\Model\UserInterface;
/**
* This class is not ready and not tested!
@@ -123,6 +124,12 @@ final class EntityDomService implements EntityDomServiceInterface
$domElement->setAttribute('id', $value->getId());
$domElement->setAttribute('name', LayerType::getReadableValue($layer));
return;
}
if ($value instanceof UserInterface) {
$domElement->setAttribute('value', $value->getId());
$domElement->setAttribute('name', 'user');
return;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Infinito\Domain\UserManagement;
use Infinito\DBAL\Types\Meta\Right\LayerType;
use Infinito\DBAL\Types\ActionType;
/**
* Containes the standart map.
*
* @author kevinfrantz
*/
interface UserSourceStandartRightMapInterface
{
const LAYER_RIGHT_MAP = [
LayerType::SOURCE => [
ActionType::READ,
ActionType::UPDATE,
],
];
}