Ensure that the a lot / storage location owner is not the anonymous user

This commit is contained in:
Jan Böhmer 2023-04-08 00:50:42 +02:00
parent d32e902d17
commit bcda71cb25
3 changed files with 14 additions and 0 deletions

View file

@ -94,6 +94,7 @@ class Storelocation extends AbstractPartsContainingDBElement
* @var User|null The owner of this storage location
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User")
* @ORM\JoinColumn(name="id_owner", referencedColumnName="id", nullable=true, onDelete="SET NULL")
* @Assert\Expression("this.getOwner() == null or this.getOwner().isAnonymousUser() === false", message="validator.part_lot.owner_must_not_be_anonymous")
*/
protected ?User $owner = null;