From 70cb6d5d949651bef9db79e7b233d044e3456975 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Wed, 22 Jul 2020 11:40:53 +0000 Subject: [PATCH] [DATABASE] Add role collumn to profile table --- src/Entity/Profile.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Entity/Profile.php b/src/Entity/Profile.php index b2fa7df3d7..ebcb527a50 100644 --- a/src/Entity/Profile.php +++ b/src/Entity/Profile.php @@ -19,6 +19,7 @@ namespace App\Entity; +use App\Core\UserRoles; use DateTimeInterface; /** @@ -42,6 +43,7 @@ class Profile private int $id; private string $nickname; private ?string $fullname; + private ?int $roles; private ?string $homepage; private ?string $bio; private ?string $location; @@ -82,6 +84,16 @@ class Profile return $this->fullname; } + public function setRoles(?int $roles): self + { + $this->roles = $roles; + return $this; + } + public function getRoles(): ?int + { + return $this->roles; + } + public function setHomepage(?string $homepage): self { $this->homepage = $homepage; @@ -183,6 +195,7 @@ class Profile 'id' => ['type' => 'serial', 'not null' => true, 'description' => 'unique identifier'], 'nickname' => ['type' => 'varchar', 'length' => 64, 'not null' => true, 'description' => 'nickname or username'], 'fullname' => ['type' => 'text', 'description' => 'display name'], + 'roles' => ['type' => 'int', 'noot null' => true, 'default' => UserRoles::USER, 'description' => 'Bitmap of permissions this profile has'], 'homepage' => ['type' => 'text', 'description' => 'identifying URL'], 'bio' => ['type' => 'text', 'description' => 'descriptive biography'], 'location' => ['type' => 'text', 'description' => 'physical location'],