mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +02:00
Make PermissionData an embeddable so doctrine can properly track changes to the data array
This commit is contained in:
parent
687ee80255
commit
59ddf91527
5 changed files with 53 additions and 47 deletions
|
@ -267,13 +267,13 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
|
||||
/**
|
||||
* @var PermissionData
|
||||
* @ORM\Column(type="permission_data", nullable=false, name="permissions")
|
||||
* @ValidPermission()
|
||||
* @ORM\Embedded(class="PermissionData", columnPrefix="permissions_")
|
||||
*/
|
||||
protected PermissionData $permissions;
|
||||
|
||||
/** @var PermissionsEmbed
|
||||
* @ORM\Embedded(class="PermissionsEmbed", columnPrefix="perms_")
|
||||
* @ValidPermission()
|
||||
*/
|
||||
protected $permissions_old;
|
||||
|
||||
|
@ -435,10 +435,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
|
||||
public function getPermissions(): PermissionData
|
||||
{
|
||||
if (!isset($this->permissions)) {
|
||||
$this->permissions = new PermissionData();
|
||||
}
|
||||
|
||||
return $this->permissions;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue