Vincent GUFFON hace 4 años
padre
commit
bdca3a177a

+ 15 - 0
src/ApiResources/Profile/AccessProfile.php

@@ -36,6 +36,9 @@ class AccessProfile implements ApiResourcesInterface
     #[Groups('access_profile_read')]
     private bool $isAdminAccess = false;
 
+    #[Groups('access_profile_read')]
+    private bool $isSuperAdminAccess = false;
+
     #[Groups('access_profile_read')]
     private ?string $name = null;
 
@@ -105,6 +108,18 @@ class AccessProfile implements ApiResourcesInterface
         return $this;
     }
 
+    public function getIsSuperAdminAccess(): bool
+    {
+        return $this->isSuperAdminAccess;
+    }
+
+    public function setIsSuperAdminAccess(bool $isSuperAdminAccess): self
+    {
+        $this->isSuperAdminAccess = $isSuperAdminAccess;
+
+        return $this;
+    }
+
     public function getOrganization(): ?OrganizationProfile
     {
         return $this->organization;

+ 16 - 0
src/Entity/Access/Access.php

@@ -58,6 +58,10 @@ class Access implements UserInterface
     #[ORM\Column(options: ['default' => false])]
     private bool $adminAccess = false;
 
+    #[ORM\Column(options: ['default' => false])]
+    #[Groups(['private'])]
+    private bool $superAdminAccess = false;
+
     #[ORM\Column(nullable: true)]
     #[Groups(['my_access:input'])]
     private ?int $activityYear = null;
@@ -150,6 +154,18 @@ class Access implements UserInterface
         return $this;
     }
 
+    public function getSuperAdminAccess(): ?bool
+    {
+        return $this->superAdminAccess;
+    }
+
+    public function setSuperAdminAccess(bool $superAdminAccess): self
+    {
+        $this->superAdminAccess = $superAdminAccess;
+
+        return $this;
+    }
+
     public function getPerson(): ?Person
     {
         return $this->person;

+ 3 - 1
src/Service/Access/AccessProfileCreator.php

@@ -95,6 +95,8 @@ class AccessProfileCreator
             ->setGender($access->getPerson()->getGender())
             ->setActivityYear($access->getActivityYear())
             ->setAvatarId($access->getPerson()->getImage()?->getId())
-        ;
+            ->setIsSuperAdminAccess($access->getSuperAdminAccess())
+            ->setOrganization($this->organizationProfileCreator->createLightOrganizationProfile($access->getOrganization()))
+            ;
     }
 }