feat: superadmin attribute for extended permissions like impersonating
This commit is contained in:
@@ -39,6 +39,9 @@ class User implements UserInterface, TimestampableEntityInterface
|
||||
#[ORM\Column(type: 'json')]
|
||||
private array $roles = [];
|
||||
|
||||
#[ORM\Column]
|
||||
private bool $superAdmin = false;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?\DateTimeImmutable $lastLoginAt = null;
|
||||
|
||||
@@ -159,6 +162,18 @@ class User implements UserInterface, TimestampableEntityInterface
|
||||
return in_array($role, $this->getRoles());
|
||||
}
|
||||
|
||||
public function isSuperAdmin(): bool
|
||||
{
|
||||
return $this->superAdmin;
|
||||
}
|
||||
|
||||
public function setSuperAdmin(bool $superAdmin): static
|
||||
{
|
||||
$this->superAdmin = $superAdmin;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastLoginAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->lastLoginAt;
|
||||
|
||||
Reference in New Issue
Block a user