mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-03 23:14:36 +02:00
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,8 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
* must have the table row "id"!! The ID is the unique key to identify the elements.
|
||||
*
|
||||
* @ORM\MappedSuperclass()
|
||||
*
|
||||
* @ORM\EntityListeners({"App\Security\EntityListeners\ElementPermissionListener"})
|
||||
*/
|
||||
abstract class DBElement
|
||||
{
|
||||
|
|
|
@ -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