add ROLE_MANAGER
This commit is contained in:
parent
f34707b082
commit
4d013a4550
|
@ -13,7 +13,8 @@ security:
|
|||
|
||||
role_hierarchy:
|
||||
ROLE_WRITER: ROLE_USER
|
||||
ROLE_ADMIN: ROLE_WRITER
|
||||
ROLE_MANAGER: ROLE_WRITER
|
||||
ROLE_ADMIN: ROLE_MANAGER
|
||||
|
||||
firewalls:
|
||||
dev:
|
||||
|
|
|
@ -70,6 +70,11 @@ class User implements PasswordAuthenticatedUserInterface, UserInterface, TwoFact
|
|||
*/
|
||||
protected $isWriter;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
*/
|
||||
protected $isManager;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
@ -118,6 +123,10 @@ class User implements PasswordAuthenticatedUserInterface, UserInterface, TwoFact
|
|||
$roles[] = 'ROLE_ADMIN';
|
||||
}
|
||||
|
||||
if ($this->getIsManager()) {
|
||||
$roles[] = 'ROLE_MANAGER';
|
||||
}
|
||||
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
|
@ -247,4 +256,16 @@ class User implements PasswordAuthenticatedUserInterface, UserInterface, TwoFact
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIsManager(): ?bool
|
||||
{
|
||||
return $this->isManager;
|
||||
}
|
||||
|
||||
public function setIsManager(?bool $isManager): self
|
||||
{
|
||||
$this->isManager = $isManager;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue