mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Substituted whitelist and blacklist attribute trough grant attribute
This commit is contained in:
parent
043c8d45b7
commit
f66cb4a8ce
24
application/src/Entity/Attribut/GrantAttribut.php
Normal file
24
application/src/Entity/Attribut/GrantAttribut.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait GrantAttribut
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $grant;
|
||||
|
||||
public function setGrant(bool $grant): void
|
||||
{
|
||||
$this->grant = $grant;
|
||||
}
|
||||
|
||||
public function getGrant(): bool
|
||||
{
|
||||
return $this->grant;
|
||||
}
|
||||
}
|
13
application/src/Entity/Attribut/GrantAttributInterface.php
Normal file
13
application/src/Entity/Attribut/GrantAttributInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface GrantAttributInterface
|
||||
{
|
||||
public function setGrant(bool $grant): void;
|
||||
|
||||
public function getGrant(): bool;
|
||||
}
|
@ -3,13 +3,12 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Attribut\BlacklistAttribut;
|
||||
use App\Entity\Attribut\WhitelistAttribut;
|
||||
use App\Entity\Attribut\NodeAttribut;
|
||||
use App\Entity\Attribut\RightAttribut;
|
||||
use App\Entity\Attribut\RecieverAttribut;
|
||||
use App\DBAL\Types\RecieverType;
|
||||
use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert;
|
||||
use App\Entity\Attribut\GrantAttribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@ -18,7 +17,7 @@ use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert;
|
||||
*/
|
||||
class Permission extends AbstractEntity implements PermissionInterface
|
||||
{
|
||||
use NodeAttribut,RightAttribut,WhitelistAttribut,BlacklistAttribut,RecieverAttribut;
|
||||
use NodeAttribut,RightAttribut,RecieverAttribut,GrantAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="reciever", type="RecieverType", nullable=false)
|
||||
@ -33,14 +32,7 @@ class Permission extends AbstractEntity implements PermissionInterface
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $blacklist;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $whitelist;
|
||||
protected $grant;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Node")
|
||||
@ -60,7 +52,6 @@ class Permission extends AbstractEntity implements PermissionInterface
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->blacklist = false;
|
||||
$this->whitelist = false;
|
||||
$this->grant = true;
|
||||
}
|
||||
}
|
||||
|
@ -2,15 +2,14 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Entity\Attribut\BlacklistAttributInterface;
|
||||
use App\Entity\Attribut\WhitelistAttributInterface;
|
||||
use App\Entity\Attribut\NodeAttributInterface;
|
||||
use App\Entity\Attribut\RightAttributInterface;
|
||||
use App\Entity\Attribut\RecieverAttributInterface;
|
||||
use App\Entity\Attribut\GrantAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface PermissionInterface extends BlacklistAttributInterface, WhitelistAttributInterface, NodeAttributInterface, RightAttributInterface, RecieverAttributInterface
|
||||
interface PermissionInterface extends NodeAttributInterface, RightAttributInterface, RecieverAttributInterface, GrantAttributInterface
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user