Removed ElementPermissionListener and ColumnSecurity annotationn

This commit is contained in:
Jan Böhmer 2022-09-18 23:38:01 +02:00
parent 51e05a8669
commit 8bc2c994d2
11 changed files with 1 additions and 408 deletions

View file

@ -61,7 +61,6 @@ use App\Entity\Parts\PartTraits\BasicPropertyTrait;
use App\Entity\Parts\PartTraits\InstockTrait;
use App\Entity\Parts\PartTraits\ManufacturerTrait;
use App\Entity\Parts\PartTraits\OrderTrait;
use App\Security\Annotations\ColumnSecurity;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
@ -100,7 +99,6 @@ class Part extends AttachmentContainingDBElement
protected $parameters;
/**
* @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"})
*/
protected ?DateTime $addedDate = null;
@ -113,14 +111,12 @@ class Part extends AttachmentContainingDBElement
/**
* @var string The name of this part
* @ORM\Column(type="string")
* @ColumnSecurity(prefix="name")
*/
protected string $name = '';
/**
* @var Collection<int, PartAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\PartAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ColumnSecurity(type="collection", prefix="attachments")
* @ORM\OrderBy({"name" = "ASC"})
* @Assert\Valid()
*/
@ -128,7 +124,6 @@ class Part extends AttachmentContainingDBElement
/**
* @var DateTime the date when this element was modified the last time
* @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"})
*/
protected ?DateTime $lastModified = null;

View file

@ -43,7 +43,6 @@ declare(strict_types=1);
namespace App\Entity\Parts\PartTraits;
use App\Entity\Parts\Part;
use App\Security\Annotations\ColumnSecurity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -55,21 +54,18 @@ trait AdvancedPropertyTrait
/**
* @var bool Determines if this part entry needs review (for example, because it is work in progress)
* @ORM\Column(type="boolean")
* @ColumnSecurity(type="boolean")
*/
protected bool $needs_review = false;
/**
* @var string a comma separated list of tags, associated with the part
* @ORM\Column(type="text")
* @ColumnSecurity(type="string", prefix="tags", placeholder="")
*/
protected string $tags = '';
/**
* @var float|null how much a single part unit weighs in grams
* @ORM\Column(type="float", nullable=true)
* @ColumnSecurity(type="float", placeholder=null)
* @Assert\PositiveOrZero()
*/
protected ?float $mass = null;

View file

@ -44,7 +44,6 @@ namespace App\Entity\Parts\PartTraits;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
use App\Security\Annotations\ColumnSecurity;
use App\Validator\Constraints\Selectable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -54,14 +53,12 @@ trait BasicPropertyTrait
/**
* @var string A text describing what this part does
* @ORM\Column(type="text")
* @ColumnSecurity(prefix="description")
*/
protected string $description = '';
/**
* @var string A comment/note related to this part
* @ORM\Column(type="text")
* @ColumnSecurity(prefix="comment")
*/
protected string $comment = '';
@ -74,7 +71,6 @@ trait BasicPropertyTrait
/**
* @var bool true, if the part is marked as favorite
* @ORM\Column(type="boolean")
* @ColumnSecurity(type="boolean")
*/
protected bool $favorite = false;
@ -83,7 +79,6 @@ trait BasicPropertyTrait
* Every part must have a category.
* @ORM\ManyToOne(targetEntity="Category")
* @ORM\JoinColumn(name="id_category", referencedColumnName="id", nullable=false)
* @ColumnSecurity(prefix="category", type="App\Entity\Parts\Category")
* @Selectable()
* @Assert\NotNull(message="validator.select_valid_category")
*/
@ -93,7 +88,6 @@ trait BasicPropertyTrait
* @var Footprint|null The footprint of this part (e.g. DIP8)
* @ORM\ManyToOne(targetEntity="Footprint")
* @ORM\JoinColumn(name="id_footprint", referencedColumnName="id")
* @ColumnSecurity(prefix="footprint", type="App\Entity\Parts\Footprint")
* @Selectable()
*/
protected ?Footprint $footprint = null;

View file

@ -44,7 +44,6 @@ namespace App\Entity\Parts\PartTraits;
use App\Entity\Parts\MeasurementUnit;
use App\Entity\Parts\PartLot;
use App\Security\Annotations\ColumnSecurity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -58,7 +57,6 @@ trait InstockTrait
* @var Collection|PartLot[] A list of part lots where this part is stored
* @ORM\OneToMany(targetEntity="PartLot", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
* @ColumnSecurity(type="collection", prefix="lots")
* @ORM\OrderBy({"amount" = "DESC"})
*/
protected $partLots;
@ -68,7 +66,6 @@ trait InstockTrait
* Given in the partUnit.
* @ORM\Column(type="float")
* @Assert\PositiveOrZero()
* @ColumnSecurity(prefix="minamount", type="integer")
*/
protected float $minamount = 0;
@ -76,7 +73,6 @@ trait InstockTrait
* @var ?MeasurementUnit the unit in which the part's amount is measured
* @ORM\ManyToOne(targetEntity="MeasurementUnit")
* @ORM\JoinColumn(name="id_part_unit", referencedColumnName="id", nullable=true)
* @ColumnSecurity(type="object", prefix="unit")
*/
protected ?MeasurementUnit $partUnit = null;

View file

@ -44,7 +44,6 @@ namespace App\Entity\Parts\PartTraits;
use App\Entity\Parts\Manufacturer;
use App\Entity\Parts\Part;
use App\Security\Annotations\ColumnSecurity;
use App\Validator\Constraints\Selectable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -58,7 +57,6 @@ trait ManufacturerTrait
* @var Manufacturer|null The manufacturer of this part
* @ORM\ManyToOne(targetEntity="Manufacturer")
* @ORM\JoinColumn(name="id_manufacturer", referencedColumnName="id")
* @ColumnSecurity(prefix="manufacturer", type="App\Entity\Parts\Manufacturer")
* @Selectable()
*/
protected ?Manufacturer $manufacturer = null;
@ -67,14 +65,12 @@ trait ManufacturerTrait
* @var string the url to the part on the manufacturer's homepage
* @ORM\Column(type="string")
* @Assert\Url()
* @ColumnSecurity(prefix="mpn", type="string", placeholder="")
*/
protected string $manufacturer_product_url = '';
/**
* @var string The product number used by the manufacturer. If this is set to "", the name field is used.
* @ORM\Column(type="string")
* @ColumnSecurity(prefix="mpn", type="string", placeholder="")
*/
protected string $manufacturer_product_number = '';
@ -82,7 +78,6 @@ trait ManufacturerTrait
* @var string The production status of this part. Can be one of the specified ones.
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Choice({"announced", "active", "nrfnd", "eol", "discontinued", ""})
* @ColumnSecurity(type="string", prefix="status", placeholder="")
*/
protected string $manufacturing_status = '';

View file

@ -43,7 +43,6 @@ declare(strict_types=1);
namespace App\Entity\Parts\PartTraits;
use App\Entity\PriceInformations\Orderdetail;
use App\Security\Annotations\ColumnSecurity;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use function count;
@ -59,7 +58,6 @@ trait OrderTrait
* @var Orderdetail[]|Collection the details about how and where you can order this part
* @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Orderdetail", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
* @ColumnSecurity(prefix="orderdetails", type="collection")
* @ORM\OrderBy({"supplierpartnr" = "ASC"})
*/
protected $orderdetails;
@ -67,14 +65,12 @@ trait OrderTrait
/**
* @var int
* @ORM\Column(type="integer")
* @ColumnSecurity(prefix="order", type="integer")
*/
protected int $order_quantity = 0;
/**
* @var bool
* @ORM\Column(type="boolean")
* @ColumnSecurity(prefix="order", type="boolean")
*/
protected bool $manual_order = false;
@ -82,8 +78,6 @@ trait OrderTrait
* @var Orderdetail
* @ORM\OneToOne(targetEntity="App\Entity\PriceInformations\Orderdetail")
* @ORM\JoinColumn(name="order_orderdetails_id", referencedColumnName="id")
*
* @ColumnSecurity(prefix="order", type="object")
*/
protected Orderdetail $order_orderdetail;