forked from mirror/Part-DB.Part-DB-server
Added a possibility to restrict the access to certain entity columns.
This commit is contained in:
parent
f31336bb87
commit
47fe76b22e
8 changed files with 271 additions and 1 deletions
|
@ -34,6 +34,7 @@
|
|||
namespace App\Entity;
|
||||
|
||||
|
||||
use App\Security\Annotations\ColumnSecurity;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
//use Webmozart\Assert\Assert;
|
||||
|
||||
|
@ -109,6 +110,16 @@ class Part extends AttachmentContainingDBElement
|
|||
/**
|
||||
* @var string
|
||||
* @ORM\Column(type="string")
|
||||
*
|
||||
* @ColumnSecurity(prefix="name")
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @ORM\Column(type="string")
|
||||
*
|
||||
* @ColumnSecurity(prefix="description")
|
||||
*/
|
||||
protected $description = "";
|
||||
|
||||
|
@ -116,6 +127,8 @@ class Part extends AttachmentContainingDBElement
|
|||
* @var int
|
||||
* @ORM\Column(type="integer")
|
||||
* @Assert\GreaterThanOrEqual(0)
|
||||
*
|
||||
* @ColumnSecurity(prefix="instock", type="integer")
|
||||
*/
|
||||
protected $instock = 0;
|
||||
|
||||
|
@ -123,12 +136,15 @@ class Part extends AttachmentContainingDBElement
|
|||
* @var int
|
||||
* @ORM\Column(type="integer")
|
||||
* @Assert\GreaterThanOrEqual(0)
|
||||
*
|
||||
* @ColumnSecurity(prefix="mininstock", type="integer")
|
||||
*/
|
||||
protected $mininstock = 0;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @ORM\Column(type="string")
|
||||
* @ColumnSecurity(prefix="comment")
|
||||
*/
|
||||
protected $comment = "";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue