Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)
This commit is contained in:
@@ -13,47 +13,27 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="kimai2_roles_permissions",
|
||||
* uniqueConstraints={
|
||||
* @ORM\UniqueConstraint(name="role_permission", columns={"role_id","permission"})
|
||||
* }
|
||||
* )
|
||||
* @ORM\Entity(repositoryClass="App\Repository\RolePermissionRepository")
|
||||
* @UniqueEntity({"role", "permission"})
|
||||
*/
|
||||
#[ORM\Table(name: 'kimai2_roles_permissions')]
|
||||
#[ORM\UniqueConstraint(name: 'role_permission', columns: ['role_id', 'permission'])]
|
||||
#[ORM\Entity(repositoryClass: 'App\Repository\RolePermissionRepository')]
|
||||
#[ORM\ChangeTrackingPolicy('DEFERRED_EXPLICIT')]
|
||||
#[UniqueEntity(['role', 'permission'])]
|
||||
class RolePermission
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
*/
|
||||
private $id;
|
||||
/**
|
||||
* @var Role
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Role")
|
||||
* @ORM\JoinColumn(onDelete="CASCADE", nullable=false)
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $role;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="permission", type="string", length=50, nullable=false)
|
||||
* @Assert\Length(max=50)
|
||||
*/
|
||||
private $permission;
|
||||
/**
|
||||
* @var bool
|
||||
*
|
||||
* @ORM\Column(name="allowed", type="boolean", nullable=false, options={"default": false})
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $allowed = false;
|
||||
#[ORM\Column(name: 'id', type: 'integer')]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
private ?int $id = null;
|
||||
#[ORM\ManyToOne(targetEntity: 'App\Entity\Role')]
|
||||
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
|
||||
#[Assert\NotNull]
|
||||
private ?Role $role = null;
|
||||
#[ORM\Column(name: 'permission', type: 'string', length: 50, nullable: false)]
|
||||
#[Assert\Length(max: 50)]
|
||||
private ?string $permission = null;
|
||||
#[ORM\Column(name: 'allowed', type: 'boolean', nullable: false, options: ['default' => false])]
|
||||
#[Assert\NotNull]
|
||||
private bool $allowed = false;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user