Added permissions for the new functions.

This commit is contained in:
Jan Böhmer 2019-09-13 17:13:58 +02:00
parent d2bae3a4f2
commit da14ee942d
14 changed files with 213 additions and 64 deletions

View file

@ -130,7 +130,7 @@ class Part extends AttachmentContainingDBElement
* @var Orderdetail[]
* @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Orderdetail", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
* @ColumnSecurity(prefix="orderdetails", type="object")
* @ColumnSecurity(prefix="orderdetails", type="collection")
*/
protected $orderdetails;

View file

@ -129,6 +129,11 @@ class PermissionsEmbed
*/
protected $parts_name = 0;
/** @var int
* @ORM\Column(type="smallint")
*/
protected $parts_category = 0;
/**
* @var int
* @ORM\Column(type="smallint")
@ -139,13 +144,7 @@ class PermissionsEmbed
* @var int
* @ORM\Column(type="smallint")
*/
protected $parts_instock = 0;
/**
* @var int
* @ORM\Column(type="smallint")
*/
protected $parts_mininstock = 0;
protected $parts_minamount = 0;
/**
* @var int
@ -157,7 +156,24 @@ class PermissionsEmbed
* @var int
* @ORM\Column(type="smallint")
*/
protected $parts_storelocation = 0;
protected $parts_lots = 0;
/**
* @var int
* @ORM\Column(type="smallint")
*/
protected $parts_tags = 0;
/** @var int
* @ORM\Column(type="smallint")
*/
protected $parts_unit = 0;
/**
* @var int
* @ORM\Column(type="smallint")
*/
protected $parts_mass = 0;
/**
* @var int
@ -165,6 +181,18 @@ class PermissionsEmbed
*/
protected $parts_manufacturer = 0;
/**
* @var int
* @ORM\Column(type="smallint")
*/
protected $parts_status = 0;
/**
* @var int
* @ORM\Column(type="smallint")
*/
protected $parts_mpn = 0;
/**
* @var int
* @ORM\Column(type="smallint")
@ -243,6 +271,17 @@ class PermissionsEmbed
*/
protected $attachment_types = 0;
/** @var int
* @ORM\Column(type="integer")
*/
protected $currencies = 0;
/**
* @var int
* @ORM\Column(type="integer")
*/
protected $measurement_units = 0;
/**
* @var int
* @ORM\Column(type="integer")
@ -276,7 +315,7 @@ class PermissionsEmbed
public function getBitValue(string $permission_name, int $bit_n): int
{
if(!$this->isValidPermissionName($permission_name)) {
throw new \InvalidArgumentException('No permission with the given name is existing!');
throw new \InvalidArgumentException(sprintf('No permission with the name "%s" is existing!', $permission_name));
}
$perm_int = $this->$permission_name;

View file

@ -166,6 +166,12 @@ class User extends NamedDBElement implements UserInterface, HasPermissionsInterf
*/
protected $group;
/**
* @var array
* @ORM\Column(type="json")
*/
protected $settings = [];
/** @var PermissionsEmbed
* @ORM\Embedded(class="PermissionsEmbed", columnPrefix="perms_")
* @ValidPermission()
@ -173,7 +179,8 @@ class User extends NamedDBElement implements UserInterface, HasPermissionsInterf
protected $permissions;
/**
* @ORM\Column(type="string", name="config_currency")
* @ORM\ManyToOne(targetEntity="App\Entity\PriceInformations\Currency", fetch="EAGER")
* @ORM\JoinColumn(name="currency_id", referencedColumnName="id")
*/
protected $currency = "";